All works well except when any single-custom_post_type.php file is loaded.
Home /Business Listings /Listing Category is a trail in which the second and third are pages with shortcodes to display the content using page.php which is fine.
‘Listing Category’ is a child page of ‘Business Listings’
‘Listings’ is also a child page of ‘Business Listings’,
however the shortcode on the page ‘Listings’ loads single-custom_post_type.php and the breadcrumb becomes
‘Home /Blog /Listings /Single listing name’
The behavior is the same for any single custom post.
I have permalinks set as
/blog/%postname%/
All works well except when any
single-custom_post_type.php
file is loaded.Home /Business Listings /Listing Category
is a trail in which the second and third are pages with shortcodes to display the content usingpage.php
which is fine.‘Listing Category’ is a child page of ‘Business Listings’
‘Listings’ is also a child page of ‘Business Listings’,
however the shortcode on the page ‘Listings’ loads
single-custom_post_type.php
and the breadcrumb becomes‘Home /Blog /Listings /Single listing name’
The behavior is the same for any single custom post.
Could you suggest a fix?
The “Blog” part of that often happens when a CPT has the
with_front
option set totrue
.Can you check args for your
register_post_type()
? It should look something like this:The
with_front
bit should befalse
.I have
which works.
Is this the best way to do and could you help combine into one statement?
I’m thinking you can simplify it down to just this: