[Resolved] A Single Category/Front Page/Maintain Layout Features

Home Forums Support [Resolved] A Single Category/Front Page/Maintain Layout Features

Home Forums Support A Single Category/Front Page/Maintain Layout Features

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1648498
    Jennifer

    Greetings,

    I need to create the ability for my site to:

    1. “only show a single category” on the front page
    2. Maintain the layout that I have set in the Gp: Blog ▸ Customizing ▸ Layout
    which are the – 3 columns – make post 1 featured and masonry (I love those Gp features – keeps me coming back -so awesome).

    I was curious, how would you use best practices to achieve the above?

    Here is a link to the site: layout is perfect, I just want ONLY Cat_ID=5 aka “headlines” to display.
    Weekly Word News

    THANK YOU LOVELY Gp PEOPLE,
    Jennifer

    #1648534
    Leo
    Staff
    Customer Support
    #1649394
    Jennifer

    Hello, reading through that ticket is seems to be problematic when loading posts and using an off-set.
    Also, where would I put that filter?
    Do I create a child theme?

    —– Where do I put this?——
    `add_action( ‘pre_get_posts’, function( $query ) {
    if ( $query->is_home() && $query->is_main_query() ) {
    $query->set( ‘cat’, ‘123’ );
    }
    } );

    #1649462
    Ying
    Staff
    Customer Support

    Hi Jennifer,

    This is how you add php:
    Adding PHP: https://docs.generatepress.com/article/adding-php/

    I personally would recommend to use Code Snippets 🙂

    #1652568
    Jennifer

    Ying and Leo,
    Code Snippet worked great. Thank you for the excellent support.

    – Jennifer

    #1654872
    Leo
    Staff
    Customer Support

    Glad we could help 🙂

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