Created
June 23, 2016 17:46
-
-
Save alisonmonteiro/c23d9e9987e15adda1d661c087a21cb4 to your computer and use it in GitHub Desktop.
Custom posts limit
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 | |
add_action('pre_get_posts', function() { | |
if (is_category('my-category') | |
$query->set('posts_per_page', 4); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment