[Resolved] Custom post type archive – Show categories

Home Forums Support [Resolved] Custom post type archive – Show categories

Home Forums Support Custom post type archive – Show categories

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #2079504
    Ema

    Hello, I have a few custom post types and would like them to display just like the news/blog page archive.

    On my CPT archive page. I have the Columns, Title, Excerpt, Read more buttons’ but would like to also show the categories and icon too? The image below is of my standard blog which I’d like all the archives to appear like.

    Best wishes and thanks in advance

    Ema

    #2079509
    Ying
    Staff
    Customer Support

    Hi Ema,

    Any chance you can link us to the blog page and the CPT archive page?

    You can use the private information field.
    https://docs.generatepress.com/article/using-the-premium-support-forum/#private-information

    Let me know πŸ™‚

    #2081330
    Ema

    Hi Ying!

    I have left the links for the pages below. At the moment my custom post archive just shows the excerpts and read more button.

    If you could point me in the right direction.

    also I add this function to grab the categories for my CPT?

    add_filter( 'generate_footer_meta_post_types', function( $types ) {
        $types[] = 'my-post-type';
        $types[] = 'recipes';
    
        return $types;
    } );

    Very Best

    Ema

    #2081484
    Ying
    Staff
    Customer Support

    The PHP code will only show the WP core categories, are the categories specific for CPT? If so, it won’t show.

    I would recommend using a block element – content template

    If you watch the video in the documentation, you should be able to create a content template easily.

    Let me know if you need further assistance πŸ™‚

    #2081567
    Ema

    Oh yes Ying, that is a possibility. I’m just trying this out now.

    Is there a way to add an excerpt from a CPT into the dynamic fields for these content layouts? I can see the CPT terms now. So, thank you!

    #2081608
    Ying
    Staff
    Customer Support

    Yes, you can use the Dynamic content block (with GP logo as the icon):
    https://www.screencast.com/t/sTorpRWISs

    #2081900
    Ema

    Thanks for your help Ying, I’ll try this out.
    πŸ™‚
    Ema

    #2082399
    Ying
    Staff
    Customer Support

    You are welcome πŸ™‚

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.