Created
October 29, 2020 12:29
-
-
Save YuvrajKhavad/1f0b4d302389d5088def14efb5f99126 to your computer and use it in GitHub Desktop.
Customise Custome taxonomy archive display page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// "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