When a link doesn’t exist, how to tell WordPress what to do? (404 Error Page)

The conditional you use to output get_template_part(‘content’, ‘none’); is only triggered if there is no post in the main loop, for example, when a category has no posts in it: if (have_posts()){ while(have_posts()) { the_post(); // If the category has a post and we are on a category page, then show the posts get_template_part(‘content’, ‘archive’); … Read more

How To Create A Custom Taxonomy 404 Page

You can filter any type of template to override the template hierarchy. In this case the filter is 404_template. We’ll check if the location query var is set, meaning the URL matched the pattern of a location request, but the result was a 404. In that case, we’ll load the 404-taxonomy-location.php template. function wpd_custom_tax_404( $templates … 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