Last active
June 28, 2018 10:12
-
-
Save aaronsummers/023e5259c88712b7c70bf4d628b6d059 to your computer and use it in GitHub Desktop.
Adding search query parameter to new WP_Query
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 | |
| $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; | |
| $args = array( | |
| 'post_type' => array('post', 'page', 'custom_post_type'), | |
| 'posts_per_page' => 12, | |
| 'paged' => $paged, | |
| 's' => $s, // $s ADDS IN THE SEARCH QUERY | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment