Search
 
SCRIPT & CODE EXAMPLE
 

PHP

wp order archive page post by title

// Sort All Tours by Title
add_filter( 'parse_query', 'sorting_archives' );
function sorting_archives( $wp_query ) {
  if (is_post_type_archive( 'tour' ) || is_tax()) {
    $wp_query->set( 'orderby', 'title' );
    $wp_query->set( 'order', 'ASC' );
  }
  return $wp_query;
}
Comment

PREVIOUS NEXT
Code Example
Php :: php error check 
Php :: how to set select option value dynamically in php 
Php :: kartik select 2 yii2 
Php :: how to pass token with post request laravel 
Php :: copy folder contect to anthor folder php 
Php :: get all post 
Php :: function in php 
Php :: how to check if all values in an array are equal php 
Php :: How To Unset Or Delete An Element From Array By Value In PHP? 
Php :: install laravel on windows 
Php :: has password argon2i 
Php :: laravel DB wherein 
Php :: laravel signed Route custom domain 
Php :: show one value after point php 
Php :: how condition for multiple row by orwhere laravel 
Php :: wp php category page count products 
Php :: country code validation in laravel 
Php :: delete data with ajax in php 
Php :: file put contents php 
Php :: Update First and Last Day of Previous Month with Carbon 
Php :: update woocommerce cart 
Php :: php array sort by key 
Php :: laravel get view variables 
Php :: PHP strtolower — Make a string lowercase 
Php :: EntityManager get repository 
Php :: php check if valid xml 
Php :: php pdo setting error modes 
Php :: php sort array by longest 
Php :: laravel select where with total sum query to get all data with sum 
Php :: How do you set a variable to an integer? in php 
ADD CONTENT
Topic
Content
Source link
Name
5+2 =