Created
February 7, 2017 13:15
-
-
Save coinso/84178aa692dc9a1ba7daf4ea524e1c62 to your computer and use it in GitHub Desktop.
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
| <?php | |
| //in this case it will show 3 | |
| function show_items_in_archive($query){ | |
| if($query->is_main_query() ){ | |
| $query->set( 'posts_per_page', 3 ); | |
| } | |
| } | |
| add_action( 'pre_get_posts', 'show_items_in_archive' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment