This topic is: not resolved
- This topic has 0 replies, 1 voice, and was last updated 3 years, 6 months ago by .
Viewing 1 post (of 1 total)
Viewing 1 post (of 1 total)
- You must be logged in to reply to this topic.
These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.
Community Forums › Forums › General Genesis Framework Discussions › Change post order
Hi
I am trying to change the post order to oldest posts first using the following code:
function change_posts_order( $query ) {
if ( $query-is_home() && $query-is_main_query() ) {
$query-set( 'orderby', 'date' );
$query-set( 'order', 'DESC' );
}
}
add_action( 'pre_get_posts', ' change_posts_order ' );
It doesn't change anything. I am also wanting to change the order for certain categories only.
Any ideas please?
Thanks
Rich
https://gucu.club/category/bible/new-testament/3-luke/© 2024 WPEngine, Inc.