Posts in order of original publication
-
We are cleaning up old posts, rewriting if necessary, improving SEO etc. on a site that has 12 years of posts. It looks as if editing a post changes it’s order on the blog page so that the old posts are being listed as most recent. Is there an easy way to write code to tell WP to list the posts in their original order? I’m not a coder but have successfully added code to my functions file in the past. Found this basic code for ordering by titles – am wondering if there is a way to do original publication date.
`function change_posts_order( $query ) {
if ( $query-is_home() && $query-is_main_query() ) {
$query-set( ‘orderby’, ‘title’ );
$query-set( ‘order’, ‘ASC’ );
}
}
add_action( ‘pre_get_posts’, ‘ change_posts_order ‘ );Yes, I’ve seen that there is a plugin. I already use so many I thought that this might be an easy fix.
The page I need help with: [log in to see the link]
- The topic ‘Posts in order of original publication’ is closed to new replies.