New answers tagged

0

It is quite easy to pinpoint issues like this, that is, if you have a mirror installation locally. All you need is a fairly decent code editor with a basic search functionality. All you would need to do then is search your wp-content folder for the functions pinpointed in the debug notices. This way, you quickly and exactly know where these functions are ...


-1

You can easily download old version from here: https://wordpress.org/download/release-archive/


2

Try antispambot(): <a href="mailto:<?= antispambot('myemail.examlple.com') ?>"> <?= antispambot('my email') ?> </a>


0

You will need to modify (or create your own) the script that does the loading to change the URL once he loads a new page. Changing the URL may not be so simple, but you can have a look at this question for tips: http://stackoverflow.com/questions/824349/modify-the-url-without-reloading-the-page


1

I found that https://wordpress.org/plugins/pinterest-widgets actually has the needed functionality but doesn't mention it in the description. After installing and activating you can add a pinboard to a post by using the following shortcodes [pin_board url="http://www.pinterest.com/pinterest/pin-pets/"] [pin_board ...


0

Go to Pinterest site and open a pin which you want to embed on your post. Now you can find 3 dots near send button in the top of the pin. Click that dots and you can see "Embed" option. Now click that. Pinterest will give you 5 options to embed their content. Pin Profile Board Follow and Pin it button Based on your requirement, select the option and ...


0

add the following code to active theme. Here I am replacing with [shell] before saving. add_filter( 'content_save_pre' , 'my_sanitize_content' , 10, 1); function my_sanitize_content( $value ) { return str_replace("<shell>", "[shell]", $value ); }


3

since WP 4.4.0, you can use this filter that allows you to change the arguments used in the original cpt registration. Add this to your functions.php file: add_filter( 'register_post_type_args', function( $args, $post_type ) { if( 'wyde_portfolio' === $post_type && is_array( $args ) ) $args['rewrite']['with_front'] = false; ...


0

Check this out function custom_title($title_parts) { $title_parts['title'] = "Page Title"; return $title_parts; } add_filter( 'document_title_parts', 'custom_title' ); In custom_title, $title_parts contains 'title', 'page' (the pagination), 'tagline' (the slogan you specified) and 'site'. Set "title" the way you like.


0

Use standard user registration. Look at a function to upgrade subscribers to custom role (https://codex.wordpress.org/Function_Reference/add_role) similar to a contributor which needs approval before publishing. Create a custom post type (CPT) for 'questions'. Your custom role can create posts for this CPT. You could then use add_submenu_page to create a ...


0

I write one php code what totaly filter all html elements but is integrated in main index.php on the root. That made rendering a little faster but you also can do CDN for all your images and media. That will speedup your page a mutch better. I normaly point /wp-content/uploads/ to subdomain and my WP get all media from that subdomain what made WP 20 times ...


0

You should install Wp total Cache plugin and configure it as instructed on this page https://gtmetrix.com/wordpress-optimization-guide.html WP total cache minify settings will remove blank spaces from css and js files but it will not remove blank spaces from php code and for that you can use php beautifier. There are many free online tools available, google ...


2

There is no concept of "containing" the settings of a single plugin in WP. Plugins use core APIs (such as Options) freely to store data. So on WordPress level to do this the whole plugin's code will need to be examined to have a complete catalog of things which need to be moved. Plugins themselves might implement their own export/import functionality. If ...


0

From your question, it might appear that this problem happens with any theme or plugin that you try to install, but most likely this is not the case -- as only themes or plugins that are coded to establish a secure HTTPS connection with a peer should be able to potentially trigger such an error condition. I find it hardly doubtful that installing from the ...


0

Well guys i post answet for anybody interested! I edited mr_permissions_roles_admin_page_restriction function because i noticed one thing: the restrictions i save are URL! so well here it is: function mr_permissions_roles_admin_page_restriction($screen) { $block=FALSE; $url=str_replace('/wp-admin/','',$_SERVER['REQUEST_URI']); global $menu; ...


1

If the links are coming from the main content areas, you could create a hook which acts against this "content" output. In your themes functions.php file, you could try something like: add_filter('the_content', 'the_url_filter_function_name', 30); function the_url_filter_function_name($content) { return str_replace('bad-url.com', 'good-url.com', ...


0

Consider integrating eCommerce functionality, for example via the WooCommerce plugin (which supports "coupon" codes).


-1

You Should go with "Gravity Forms" http://www.gravityforms.com/ Try This.


0

An update as I figured out somethings for myself: dialog.js is not part of the core jQuery UI and thus isn't available via the standard jQuery handle. I have found queuing it difficult and to differ in success over theme's I tried. If it works it looks, to put it nicely, a bit crappy so that requires more work. I settled with jquery and used a regular form ...


0

You can achieve your task in both ways through plugin as well as coding Manually Please see the documentation on URLs of Namespaced Custom Post Types Identifiers. One of the options available to you is to add a 'rewrite' argument to register_post_type(). From the docs: Plugin Custom Post Type Permalinks allow you edit the permalink structure of custom ...


1

I am not sure I follow your question, title seems different from question itself. You seem to want to get rid of index.php in URL? It's hard to say confidently from outside, but it looks like PATHINFO permalink. If that's the case you would need to change your WP permalink configuration to more common "pretty" one. Doesn't have anything to do with CPT's ...


-1

Change or add the 'rewrite' => array( 'slug' => 'luckydraw', 'with_front' => false ), into the register_post_type arguments, This will change the slug of your custom post type.


3

I think you could get around this by pre-running the shortcodes on the page by applying the content filters before the header is output. This should allow any internal shortcodes run inside the included post to add any action hooks properly and thus any needed stylesheets/resources. add_action('wp_loaded','maybe_prerun_shortcodes'); function ...


0

There's the plugin Rel Nofollow now, which does what needed here. Quoting its description: When a post is saved, the plugin adds the rel="nofollow" attributes to post links. The plugin also provides an apt checkbox to exclude a post from plugin's action.


2

There is no order_by. Change order_by to orderby and it should work. The default value of compare is = so it is unnecessary, you can remove it. Also, you should specify type of the meta_value if it is a specific type rather than the default CHAR.


1

If I get this right each of your posts have one value of Exercise and one Value of Tempo? I would do the following probably: Build a list of exercises. For each exercise query query: 1 posts, ordered by Tempo, descending. This is probably as good as it gets staying within realm of WP API. Might not be practical for high counts of Exercises, it's all ...


2

You could filter the include paths returned by get_included_files by removing any files from the list that are not in your theme (and/or child theme) directory: function get_theme_includes() { $includedfiles = get_included_files(); // normalize theme paths for matching $styledir = str_replace("\\","/",get_stylesheet_directory()); ...


0

That's called Thickbox. Since you give no clue what you want to use it for, you'll have to figure out the rest for yourself...


3

This may be a silly idea, but it might work: 1 Let your shortcode explode to an iframe with a custom query_var (tutorial). Like this: <iframe src="http://www.example.com/?p=123&my_query_var=content_only"></iframe> 2 In your single.php detect the query_var and in that case skip visual header, sidebars, footer - anything not connected to ...


2

Load visual compose css function get_visual_composer_style($id) { return '<style>' . get_post_meta( $id, '_wpb_shortcodes_custom_css', true ) . '</style>'; } Load css based on shortcode function custom_shortcode_scripts() { global $post; if( is_a( $post, 'WP_Post' ) && has_shortcode( ...


1

You first have to build a query for your posts, and inside that query you would get all your custom fields and compare them. You could use a plugin like CMB2 to build repeatble grouped fields so you can get the exercises grouped (all Excercises1, all Excercises2, etc) and also asign each to have a TEMPO field attached to that group. It would be easier then ...


1

This will delete the post, the post metadata, and any terms used on the post. It will not delete the terms themselves. The PHP script is similar to this but slower. Replace {{your CPT}} with the identifier for your custom post type and pop this in your database on phpmyadmin or mysql. DELETE a,b,c FROM wp_posts a LEFT JOIN wp_term_relationships b ...


2

Thanks for your answer @rarst. The issue came from my nginx configuration. I just had to change add_header X-Frame-Options deny; to add_header X-Frame-Options "SAMEORIGIN" always;


4

Your error log does tell you the reason, it's the part about: Refused to display ... in a frame because it set to 'X-Frame-Origin' to 'SAMEORIGIN,DENY' And the reason for that is the one about "conflicting values" before it. WordPress core only sends SAMEORIGIN value in admin screens, via send_frame_options_header(). So DENY is coming from elsewhere ...


2

Your site has been infected with fake jquery. Check the Sucuri scan (i have no affiliation with this company). The root infection may be in your 404 template, but if you don't know where to start you're better of seeking professional support.


1

The general implementation of such "pretty" permalinks in WordPress is realm of WP Rewrite. However it is pretty wide topic and low level code is a bit of abomination. I would say these are three most common techniques for it, complexity ascending: Use WordPress native data structures (such as Custom Post Types and/or Taxonomies) and benefit from ...


0

We provide two two support platforms for the plugin. If you bought a support plan, you can post your question on the dedicated support portal. If you did not buy a support plan, you can post it in the public support section on the plugin page. Please just note that the response time, in such case, will be longer, as we review that section every couple of ...


0

WordPress has a fairly good roles and capabilities system already and, IMHO, you'd find it easier working with that. When the admin menu is constructed, every item on the admin menu is subject to a check on a relevant capability. Similarly every attempt to use an admin screen is checked. It's possible to use map_meta_cap to rework some of these ...


2

No, it is not possible to create third level menu in admin panel. If you look at the definition of add_submenu_page, you need to mention the parent slug name. For eg: add_menu_page ( 'Test Menu', 'Test Menu', 'read', 'testmainmenu', '', '' ); add_submenu_page ( 'testmainmenu', 'Test Menu', 'Child1', 'read', 'child1', ''); The first parameter of the ...


0

There is a Woocommerce setting to force SSL on the checkout page only. It's in Woocommerce > settings > checkout > Force secure checkout As a side note, and someone correct me if I'm wrong on this, but I've recently heard that it actually doesn't matter if the page is loaded over https as the only connection that has to be a secure ssl connection ...


2

If I've understood you correctly, you want each coach/trainer to be able to publish a page that any site visitor can read, but not to be able to edit each others pages. If you just set each of these users to the Author role, then that should work.


0

Wordpress HTTPS doesn't solely secure the site. It just allows a page/pages/sections to be forced to HTTPs. You still need a certificate. Our company uses Wordpress HTTPS in combination with an SSL certificate installed to the server. We also process through Authorize.net, and have not experienced issues (WP 4.4.2); though, we're still updating our theme to ...


2

If you are looking to use HTTPS, I reccomend following this wordpress guide: https://make.wordpress.org/support/user-manual/web-publishing/https-for-wordpress/#implementing-https-for-wordpress You can get a free SSL Certificate from: https://letsencrypt.org/ If you find difficulty setting it up, you can often pay your host a small fee to help set this up. ...


1

If you actually mean a main file (the one with header data) inside the plugin you can rename it freely. I think the only thing would happen is that it will deactivate on update and will need to be activated again by user. But if you mean plugin slug in the repository (the one in URL) — those are fixed in stone (or at least SVN) and cannot be changed.


0

Create a page for this purpose, which you can filter its content later UNLESS you are working other way. Add the page ID to the rewrite rule init function: add_action('init', function() { $page = get_post( 2 ); // replace 2 with page ID add_rewrite_rule( '([^/]+)/([^/]+)/?$', 'index.php?pagename=' . $page->post_name . ...


0

You need to use the slug argument: /wp-json/wp/v2/pages?slug=happy-days


1

Disclaimer: I am not a lawyer. The issue here is the Apache license. You are free to distribute your own work under as many license varients as you want. After all you retain copyright. But if you include other peoples work in the distribution, every license varient you distribute under needs to be compatible. However, the Apache license is actually pretty ...


0

Alternatively, make an array of the titles and then use implode... $prerequisites = get_post_meta($post->ID, 'opl_prerequisites', TRUE); $titles = array(); foreach( $prerequisites as $prerequisite ){ $titles[] = get_the_title( $prerequisite ); } $output .= '<td>'.implode(",", $titles).'</td>';


1

Passing true as the 3rd parameter to get_post_meta() says to return only one item. Pass false, or leave it empty, to get an array of matching meta items. The foreach loop below should work, then remove the extra comma if present. $prerequisites = get_post_meta($post->ID, 'opl_prerequisites', FALSE); $td_output = '<td>'; foreach( $prerequisites ...


1

Not sure about the root cause, but you should avoid using relative paths to files. Because they are relative you never sure where exactly a file is being looked after. It might even become a security risk as PHP might look for the file in the default directories. The proper way is to use the plugin_dir_path, something like require_once ...



Top 50 recent answers are included