Created
August 11, 2016 10:24
-
-
Save tac-design/048e8a616e3bd2fba7c02af3ae44c507 to your computer and use it in GitHub Desktop.
This file contains 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
<?php | |
//example function to customise query | |
function tac_customise_query( $query ) { | |
if ( is_admin() || ! $query->is_main_query() ) | |
return; | |
if ( is_post_type_archive( 'post' ) ) { | |
$query->set( 'posts_per_page', 9 ); | |
return; | |
} | |
} | |
add_action( 'pre_get_posts', 'tac_customise_query', 1 ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment