Support » Plugin: Post Types Unlimited » Need CPT Archive Page to show correct Archive title + correct breadcrumbs

  • Resolved farou777

    (@farou777)


    Hello AJ,

    I installed your post type unlimited plugin alongside with the “Custom Post Type Date Archives” plugin so I could have an archives widget showing my past Custom Posts. And it works BUT I have a problem with page titles and permalink structure I think.

    If you go to the link I attached and opened any of the monthly regular blog post archives links, you notice that the page title will be “Monthly Archives: August 2019” and the breadcrumbs says “Home » 2019 » Monthly Archives: August 2019”. Good.

    If you do the same for a CPT archive link, the page title will just be the CPT name and the breadcrumbs says “Home » CPT-name”

    How can I make my CPT archive page work just like regular archive page? So users know what they are browsing. And by the way, why do I need that extra archive plugin if when I created my CPT I check the box that says “Has Archive”?

    Meaning that I would liek th epage title to say and the bread

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author WPExplorer

    (@wpexplorer)

    Hi,

    How can I make my CPT archive page work just like regular archive page?

    The reason it doesn’t work the same way is because date based archives are not a part of custom post types by default. So you will need to use some child theme code to alter the default title via the wpex_title filter, eg: https://wpexplorer-themes.com/total/snippets/alter-main-page-title/

    Now, I’m not exactly sure how the plugin you are using for adding these post type date based archives works so it may or may not return true for WordPress core conditionals like “is_date”: https://codex.wordpress.org/Function_Reference/is_date – if it does work then changing the title is pretty easy, otherwise your custom code is going to be a bit more complex.

    And by the way, why do I need that extra archive plugin if when I created my CPT I check the box that says “Has Archive”?

    The “Has Archive” option is the “has_archive” parameter when creating post types in WordPress: https://codex.wordpress.org/Function_Reference/register_post_type – which enables the Post Type archive. For example if your post type is named “books” it creates a page at site.com/books/ where you can view all the posts in this type.

    What you are referring to are date based archives which are only intended for standard posts in WordPress, that’s why you need another plugin as you are basically extending the core functionality of WordPress.

    – AJ

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.