Skip to main content
added 30 characters in body
Source Link
Johansson
  • 15.4k
  • 11
  • 43
  • 79

I'm not sure why all solutions here are pretty much overkilling it. OK, it's half a decade ago, but I'm just running the following code currently and it works:

<?php // Default $wheels_args = array( 'post_type' => 'wheels', 'posts_per_page' => '96', 'orderby' => 'taxonomy, name', // Just enter 2 parameters here, seprated by comma 'order'=>'ASC' ); $loop = new WP_Query($wheels_args); ?>

   <?php // Default
    $wheels_args = array(
        'post_type' => 'wheels',
        'posts_per_page' => '96',
        'orderby' => 'taxonomy, name', // Just enter 2 parameters here, seprated by comma
        'order'=>'ASC'
    );
    $loop = new WP_Query($wheels_args);
    ?>

This will sort the taxonomies of your CPT first by it's taxonomy in alphabetical order and within these taxonomy groups als by alphabetical order.

I'm not sure why all solutions here are pretty much overkilling it. OK, it's half a decade ago, but I'm just running the following code currently and it works:

<?php // Default $wheels_args = array( 'post_type' => 'wheels', 'posts_per_page' => '96', 'orderby' => 'taxonomy, name', // Just enter 2 parameters here, seprated by comma 'order'=>'ASC' ); $loop = new WP_Query($wheels_args); ?>

This will sort the taxonomies of your CPT first by it's taxonomy in alphabetical order and within these taxonomy groups als by alphabetical order.

I'm not sure why all solutions here are pretty much overkilling it. OK, it's half a decade ago, but I'm just running the following code currently and it works:

   <?php // Default
    $wheels_args = array(
        'post_type' => 'wheels',
        'posts_per_page' => '96',
        'orderby' => 'taxonomy, name', // Just enter 2 parameters here, seprated by comma
        'order'=>'ASC'
    );
    $loop = new WP_Query($wheels_args);
    ?>

This will sort the taxonomies of your CPT first by it's taxonomy in alphabetical order and within these taxonomy groups als by alphabetical order.

Source Link

I'm not sure why all solutions here are pretty much overkilling it. OK, it's half a decade ago, but I'm just running the following code currently and it works:

<?php // Default $wheels_args = array( 'post_type' => 'wheels', 'posts_per_page' => '96', 'orderby' => 'taxonomy, name', // Just enter 2 parameters here, seprated by comma 'order'=>'ASC' ); $loop = new WP_Query($wheels_args); ?>

This will sort the taxonomies of your CPT first by it's taxonomy in alphabetical order and within these taxonomy groups als by alphabetical order.