Archived topic
Exclude Latest Post from Page Hero
1 reply · Started by Daniel on July 27, 2022
Hi,
I use a page hero on my start page, and I would like to remove the latest post from the page hero (start with the second latest post). Nevertheless, the latest post should be visible in the post list below.
I found this code snippet that removes the latest post from the page hero, but unfortunately also from the post list:
add_filter( 'pre_get_posts', function( $query ) {
if ( $query->is_home() && $query->is_main_query() ) {
$query->set( 'offset', '1' );
}
} );
Is there a way to remove the latest post only from the page hero, but not from the post list?
Hi Daniel,
To have a better understanding of the issue, may you kindly provide the link to the site in question?
You may use the private information field for this: https://docs.generatepress.com/article/using-the-premium-support-forum/#private-information
Hope to hear from you soon.