• Resolved yuval10731073

    (@yuval10731073)


    Hey guys! ??

    By default, the posts on my homepage are lined from oldest to newest. How can I change the order that they are showed?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Sounds like your theme’s index.php template file uses a custom query that needs amending. You can switch temporarily to the default theme to confirm this.

    Thread Starter yuval10731073

    (@yuval10731073)

    I couldn’t quite understand what you were saying. Isn’t it default for all themes to show the posts in the order that they were posted?

    Save messing around with query strings, and query_posts, add this to your theme’s functions file.

    add_filter( 'pre_get_posts' , 'home_order_switch' );
    function home_order_switch( $query ) {
    	if( $query->is_home )
    		$query->set( 'order' , 'asc' );
    	return $query;
    }

    NOTE: Make sure this is placed inside the opening and closing PHP tags, backup first if in doubt.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How Can I Change Post Order?!’ is closed to new replies.