Arrange posts by "order" attribute in WordPress
It's just simple as this function:
function my_get_posts( $query ) {
if ( is_home() && false == $query->query_vars['suppress_filters'] )
$query->set('orderby', 'menu_order');
$query->set('order', 'ASC');
return $query;
}
Basically, you need to order the posts by menu_order attribute.
function my_get_posts( $query ) {
if ( is_home() && false == $query->query_vars['suppress_filters'] )
$query->set('orderby', 'menu_order');
$query->set('order', 'ASC');
return $query;
}
Basically, you need to order the posts by menu_order attribute.
Comments
Post a Comment