Skip to content

Instantly share code, notes, and snippets.

@YuvrajKhavad
Created October 29, 2020 12:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YuvrajKhavad/1f0b4d302389d5088def14efb5f99126 to your computer and use it in GitHub Desktop.
Save YuvrajKhavad/1f0b4d302389d5088def14efb5f99126 to your computer and use it in GitHub Desktop.
Customise Custome taxonomy archive display page
// "product_category" is custome taxonomey name
add_action( 'pre_get_posts', 'customise_products_taxonomy_archive_display' );
function customise_products_taxonomy_archive_display ( $query )
{
if (($query->is_main_query()) && (is_tax('product_category')))
{
//$query->set( 'posts_per_page', '10' );
$query->set( 'orderby', 'title' );
$query->set( 'order', 'ASC' );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment