template structure for CPT not clear

Sorry I was using wrong structure, after looking through a bit more i found out exact difference for CPT and cutom taxonomies. For custom post types the template structure is like:-\ single-{post-type}.php archive-{post-type}.php search.php index.php And for Custom taxonomies, the template structure I found out from here:- Link:-Templates for Custom Post Types and Custom Taxonomies

single.php being ignored, going straight to attachment.php

OK, well, I’ve put the search for a proper answer on hold and instead cobbled together a ‘for now’ solution. First, in the referring page that is linking to the individual Post page, I’ve added this: $theid = $post->ID; echo “<li><a href=””; the_permalink(); echo “?id=” . $theid; echo “”>”; echo “blah”; echo “</a>”; So, on … Read more

URL rewrite before template_redirect called

So the problem was redirect_guess_404_permalink was detecting a 404 error and ‘guessed’ /members/blog to be /blog My hacky solution was to hook into the status error check (Stop WordPress from “guessing” redirects for nonexistent URLs) and if URL parts match then unset the guessed solution function blog_no_redirect_guess_404_permalink( $header ){ global $wp_query; if( is_404() ) { … Read more

custom template only for content

You can’t override template parts. Even if you could, you would have no way of knowing what template part you’d need to replace. A theme is only required to have an index.php file and there are no restrictions or naming convention for template parts. Your options are to create a full template and leave it … Read more