• Resolved kasin78

    (@kasin78)


    Hello,

    I have created a CPT for Case Studies (slug: casestudies).

    I followed the steps mentioned at https://generatepress.com/forums/topic/remove-the-word-archives-in-front-of-cpt-archive-pages/ and got rid of the prefix “Archives:” from the CPT archive page. (It was extremely simple to do with Code Snippets plugin. Thanks Tom!)

    Now I’m wondering if it’s possible to add a small description below the CPT title, like in the normal Category Archive pages. (eg. https://www.reikihealerslounge.com/reiki/)

    I don’t want to create a whole new archive.php for this. I’m not that familiar with code. If it’s possible to just add another small Code Snippet shortcode and get this, that would be super awesome!

    Thanks and regards,
    Kads

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Theme Author Tom

    (@edge22)

    Hi there,

    Absolutely, you can do this:

    add_action( 'generate_after_archive_title', function() {
        if ( is_post_type_archive( 'casestudies' ) ) :
            ?>
                Your description in here.
            <?php  
        endif;
    } );

    Let me know if you need more info ??

    Thread Starter kasin78

    (@kasin78)

    Oh wow! That works beautifully! Can’t differentiate at all from the Category archive pages! ?? ?? ??

    Thanks a ton @edge22!

    One more quick question…

    Right now, I only have two Case Studies, but when I put in more, will this Archive page automatically show the ‘previous-next’ navigation at the bottom (like in Category pages)?

    Theme Author Tom

    (@edge22)

    Yes, pagination should happen automatically ??

    Thread Starter kasin78

    (@kasin78)

    Cool, thanks! ??

    Theme Author Tom

    (@edge22)

    No problem!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Custom Post Type Archive Page’ is closed to new replies.