Support » Fixing WordPress » query-vars not merging

  • I noticed that many of my category links were broken after updating to 4.0

    This is what my original code looked like to order the posts alphabetically regardless of what category the user selected:

    $args = array_merge( $wp_query->query_vars, array( 'orderby' => 'title', 'order' => 'ASC' ) );

    Since it wasn’t working I had to use this code:

    $originalargs = $wp_query->query_vars;
    $catname = $originalargs['category_name'];
    $args = array('category_name'=> $catname,'orderby' => 'title', 'order' => 'ASC');

    Wondered if anyone else has run into this problem.

  • The topic ‘query-vars not merging’ is closed to new replies.