How to include local menu based on page id?
You can also check if you are on page template with is_page_template function: if(is_page(array(18,52,22,20)) || is_page_template( ‘blog.php’ )) { //do your stuff }
You can also check if you are on page template with is_page_template function: if(is_page(array(18,52,22,20)) || is_page_template( ‘blog.php’ )) { //do your stuff }
In your tax query, you’re searching for a string instead of a variable, the only time it will match currently is if the term is literally “$page_slug”. You should remove the single quotes around the $page_slug to have it parsed as a variable, so: ‘terms’ => ‘$page_slug’ should be: ‘terms’ => $page_slug,
This is going to track only post_type query var, but you also can add checks for query_vars of all your post_types or only ones you would like to get a custom 404 page for. add_filter( ‘404_template_hierarchy’, function( $templates ) { global $wp_query; if ( ” !== $wp_query->get(‘post_type’) ) { array_unshift( $templates, sprintf( ‘%s-404.php’, $wp_query->get(‘post_type’) ) … Read more
You mentioned that you disabled all plugins, and changed the theme (I assume you used one of the ‘twenty’ themes, which is what I usually do when trying to find theme/plugin problems). Did you also look at the ‘must use’ plugins (in wp-content/mu-plugins ) (see https://codex.wordpress.org/Must_Use_Plugins ). Maybe a plugin in there is causing problems. … Read more
No, not unless you push the change manually. More specifically, WordPress has no concept of production/preprod/etc or of pushing/pulling. These features are always implemented by hosts or custom software, and are extensions of WP, not parts of WP itself. Otherwise, production and preprod etc are just 2 separate WP installations that just happen to be … Read more
Option 1 Have you tried changing the function name? something similar function getClientFn($function){}? You can keep any name you want. function getClientFn($function){ return ‘\DisplaceTech\Companies\\’ . $function; } function add_clients_metabox(){ $screens = [‘page’]; foreach ($screens as $screen) { add_meta_box( ‘clients’, // Unique ID __(‘Clients’), // Box title getClientFn(‘clients_box_html’), // Content callback, must be of type callable … Read more
This was caused by the Redirection plugin. Apparently it is trying to help by setting up redirects when you change the slugs for pages/posts. You have to click on “Groups” at the top of the Redirection plugin settings and then choose “Modified posts” to see the redirection that was automatically created to point from the … Read more
Yeah they’ve moved the parameters to WP_Query. You’re looking for the post_parent parameter.
Go to the Permalink page (in Settings), and choose custom structure, and use something like this: /%year%/%monthnum%/%day%/%postname%/00%post_id%
It is not impossible, but you need to be very careful to prevent conflicts. You can use my Rewrite analyzer plugin to look at your current rules. The structure you propose, where the custom post type is stored in the URL hash (the part after the #), will not work because this part is not … Read more