Archive page for custom post type not working

I use a plugin called CPT-onomies to create Custom Post Types. I created a post type called “case”, and set “Has Archive Page” to true, but when i try to view a single case, i just get 404’d. Same thing also happens if i try to view the actual archive, eg. “site.com/case” and not “site.com/case/case-item”. … Read more

Add custom post type archives to search results?

How do I get WP search results to include custom post type (CPT) archives? For example, if I have CPT ‘career’ whose title (in the template php) is ‘Careers’, how do I get search results to include the CPT archive URL (www.my-domain.com/careers) for “careers”, “career”, “jobs”. I suppose the question might be, can one insert … Read more

Display Next/Prev when looping Custom post-types archive?

I’m trying to display the Next/Prev navigation buttons on my page which displays all of the pages within my ‘events’ custom post-type. The issue is that the buttons are not even displaying, but I have no idea why not. I have had this working with my Blog page posts, but I wonder whether there is … Read more

Add the current menu item CSS class to a custom page type archive in WordPress menu

I’ve been reading a lot about this but couldn’t find a solution. Basically I’m trying to show a current menu item on a dynamic page that is created by a custom page type archive. The default menu control doesn’t add the current-menu-item CSS class names. I’ve found a solution here – http://bloggingsquared.com/blogging-tips/how-to-add-the-current-menu-item-css-class-to-a-custom-link-in-a-wordpress-menu/ Which is like … Read more

Archive template

I have several custom post types and we need to create separate archive templates for these. I tried the following advice, but it’s still using the default archive template. In the form of the single-type-template. In the same way that posts are shown on their own page with single.php, custom post types will use single-{posttype}.php … Read more

add_rewrite_endpoint() and Custom Post Type Archive

I’ve got a custom post type. Let’s call it books. I’m adding a new rewrite endpoint called pages. I want the url /books/pages/2/ to work but I don’t see any rewrite rules generated by WordPress for this. I can manually add the rewrite rules for this specific example, but I’m looking for a way to … Read more

Ordering Posts Type A by Custom Fields of related Post Type B

I’m not sure if this is even possible (also posted to ACF forum https://support.advancedcustomfields.com/forums/topic/ordering-by-custom-field-of-relationship-field-object/#post-62454) I have two custom post types, Artworks and Artists. Artworks has an ACF post object field ‘artists_name’ relating it to a single Artist. Artists have custom fields ‘artist_last_name’ and ‘artist_first_name’. On the Artworks archive page, posts are ordered by meta_value of … Read more