Search
 
SCRIPT & CODE EXAMPLE
 

PHP

pre_get_posts order by title

if( $query->is_main_query() && $query->is_post_type_archive('ebooks') ) {
    $query->set( 'orderby', 'title' );
    $query->set( 'order', 'ASC' );
    $query->set( 'posts_per_page', 50 );
}
Comment

PREVIOUS NEXT
Code Example
Php :: phpstorm using extract to create variales 
Php :: change laravel port 
Php :: laravel eloquent with nested 
Php :: laravel create model for existing table 
Php :: php check if stdclass object has property 
Php :: laravel form request validation api 
Php :: php dar echo em um stdClass 
Php :: laravel route parameters 
Php :: Method IlluminateDatabaseEloquentCollection 
Php :: Laravel unique with Validation with multiple input value 
Php :: laravel disable logging 
Php :: laravel schedule kernel code sample 
Php :: bind param php 
Php :: php config file 
Php :: get object value by key php 
Php :: Ajax refreshing custom mini-cart count and content in Woocommerce 
Php :: can i back up mysql database from php code? 
Php :: laravel 8 livewire tutorial 
Php :: livewire calendar for laravel 9 
Php :: wp post view 
Php :: laravel eloquent update quantity 
Php :: if else in php 
Php :: array_filter in php 
Php :: laravel api error return homepage 
Php :: laravel crud example 
Php :: laravel eloquent with 
Php :: Call to undefined method IlluminateDatabaseEloquentRelationsHasMany::attach() 
Php :: how to separate admin and user login in laravel 
Php :: laravel, if -get() array is not emtpy 
Php :: laravel eloquent relationships 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =