Site logo

[Resolved] How to categorise my home page hero

Home Forums Support [Resolved] How to categorise my home page hero

Home Forums Support How to categorise my home page hero

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #2455254
    Lokeish

    Hi,

    I am a new customer and I loved the theme. I am wondering how to categorise my home page. All I could see is the same articles (current posts). Please help me how to do that. I tried dynamic data but still i am not able to do this. I need featured image and heading to my selected.tags/categories

    #2455285
    Fernando
    Customer Support

    Hi Lokesh,

    You can try adding this snippet:

    function generate_home_category( $query ) {
        if ( $query->is_home() && $query->is_main_query() ) {
            $query->set( 'category-name', 'affiliate-marketing, uncategorized' );
        }
    }
    add_action( 'pre_get_posts', 'generate_home_category' );

    Adding PHP: https://docs.generatepress.com/article/adding-php/#code-snippets

    Replace affiliate-marketing and uncategorized with your categories.

    This will show posts only from those categories. With your current structure, the images and titles are already showing.

    If you’re referring to something else, let us know.

    #2455757
    David
    Staff
    Customer Support

    Hi there,

    please reply in the topic not too any email notifications this will help you and us keep track of your requests.

    please raise a new topic for new unrelated questions.

    #2456645
    Lokeish

    Thank you.

    #2456841
    David
    Staff
    Customer Support

    You’re welcome

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