Site logo

Archived topic

A Single Category/Front Page/Maintain Layout Features

5 replies · Started by Jennifer on February 6, 2021

Viewing posts 1–6 of 6

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

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' );
}
} );

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

- Jennifer

Glad we could help :)

This archived topic is closed to new replies.