Using page slug in array

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,

Custom Template 404 for specific custom post type

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

Getting a 404 error when clicking edit page

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

syntax issue on php 7.4

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

Slug is redirecting to 404

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