Site logo

[Support request] How to add category posts to blog pages

Home Forums Support [Support request] How to add category posts to blog pages

Home Forums Support How to add category posts to blog pages

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #2007010
    Jean

    Hello! How do I add blog posts to my category blog pages? If I post a recipe on my static homepage, how do I get this post to appear inside my recipe page as a custom designed thumbnail with header?

    #2007057
    Ying
    Staff
    Customer Support

    Hi Jean,

    Not sure I fully understand your question, if you created a new post and assigned a category to it, it should automatically show on the category archive page.

    Can you link me to your site and explain a bit more?

    #2007066
    Jean

    Hi Ying!
    I have separate “category” pages listed in my primary nav menu. For instance, when I post a recipe- I want that recipe to show up under the page that was created in the primary nav menu (Recipes- sub-menu desserts).

    #2007070
    Ying
    Staff
    Customer Support

    Your site is in maintenance mode so I can’t see. Can you provide login in the private info field?

    Do you mean you created a static page (actual page) to manually add the post thumbnail to that page?

    If so, that does NOT sound right.

    The better way to do is to create a content template using block element and apply the template applies the selected pages/archives.

    For more info, please watch the video:
    https://docs.generatepress.com/article/block-element-content-template/

    In this way, after you set up the content template, you don’t have to manually do anything, every post should be appearing automatically under its category pages and blog page.

    Let me know if you need further assistance 🙂

    #2007249
    Jean

    Thank you! I did not manually add anything- but I was able to solve my dilemma of categories vs pages and have set this up correctly. I am using the content template block element for my category archive pages, but I need help with:
    -How to get post title to appear under thumbnail
    -How to custom layout the thumbnails so they are four per row (I realize I do not have enough posts for this yet, but I still want to configure the layout this way)

    Thanks again!! =) Please see private info.

    #2007278
    Elvin
    Staff
    Customer Support

    Hi Jean,

    -How to get post title to appear under thumbnail

    You can use GenerateBlocks’ Headline block. GB’s Headline block has dynamic value that should allow you to set the dynamic post title for the post cards.

    -How to custom layout the thumbnails so they are four per row (I realize I do not have enough posts for this yet, but I still want to configure the layout this way)

    You can set the columns per row on category pages through Appearance > Customize > Layout > Blog as shown here – https://share.getcloudapp.com/v1ujPLNA

    But this will apply to ALL archive pages. If you need this to apply on category archives only, you’ll need to do it with PHP snippets.

    Example:

    add_filter( 'generate_blog_get_column_count','tu_search_column_count' );
    function tu_search_column_count( $count ) {
        if ( is_category() ) {
            return 25;
        }
    
        return $count;
    }

    Note: You have to watch this incase you’ve yet to see this.

    It’s video guide to Block Element – Content Template.

    #2007305
    Jean

    Thank you, Elvin! Very helpful. I was able to get the post title to appear under the thumbnail!
    I didn’t want posts to be in columns on my home page, so I added the snippet- but it made my home page into columns as well so I undid the appearance/customize/columns. I may have done something wrong…

    #2007312
    Elvin
    Staff
    Customer Support

    but it made my home page into columns as well so I undid the appearance/customize/columns.

    If you don’t want the home page to be affected, that’s good that you undid it.

    In this case, what you need is the PHP snippet I shared previously which is this one:

    add_filter( 'generate_blog_get_column_count','category_column_count' );
    function category_column_count( $count ) {
        if ( is_category() ) {
            return 25;
        }
    
        return $count;
    }

    Here’s how to add PHP snippets – https://docs.generatepress.com/article/adding-php/

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