• Hello!
    Currently at the bottom of the single post i have 3 related blog post ordered from newest to oldest (from right to left)

    I want to change the order of this to show from oldest to newest (from right to left)

    So far i have tried to add the following code on the functions file like this but has not worked so far:

    function change_posts_order( $query ) {
    if ( $query->is_single(‘postid-604’) ) {
    $query-set( ‘orderby’, ‘title’ );
    $query-set( ‘order’, ‘DESC’ );
    }
    }
    add_action( ‘pre_get_posts’, ‘ change_posts_order ‘ );

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Change Related post order’ is closed to new replies.