Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="center">
- <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
- <?php include 'product.php' ?>
- <?php endwhile ?>
- <nav class="pagination">
- <?php
- $big = 999999999; // need an unlikely integer
- echo paginate_links( array(
- 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
- 'format' => '?paged=%#%',
- 'current' => max( 1, get_query_var('paged') ),
- 'total' => $wp_query->max_num_pages,
- 'prev_text' => __(' « '),
- 'next_text' => __(' » '),
- ) );
- ?>
- </nav>
- <?php else : ?>
- <p>
- <?php esc_html_e( 'Sorry, no posts matched your criteria.' ); ?>
- </p>
- <?php endif; ?>
- </div>
- function search_filter($query) {
- if ( !is_admin() && $query->is_main_query() ) {
- if ($query->is_search) {
- $query->set('post_type', array( 'drzewa_formowane', 'pre_bonsai' ) );
- }
- }
- }
- add_action('pre_get_posts','search_filter');
Add Comment
Please, Sign In to add comment