Custom query result empty on page 2

It’s a custom dynamic page, used only for this specific query result. The problem was form action=”” being empty. $_GET parameters were sent to the same page i.e. /result-page/?filter-options=800 which is fine but while on page-2, the results were sent to /result-page/page/2/?filter-options=800. Setting the form action=”/result-page” solved the problem. Thanks.

How to search through all child taxonomies using WP_Query?

Finally figured out the solution. Answering it if anyone finds it useful. Where $_GET[‘s_qr’] has a search query from a user from another page. $i = 0; $parent_name=””; $taxonomyName = “product-cat”; $search_r = array(); $parent_terms = get_terms( $taxonomyName, array( ‘parent’ => 0, ‘orderby’ => ‘slug’, ‘hide_empty’ => false ) ); foreach ( $parent_terms as $pterm … Read more

Query for current post

You shouldn’t be writing any query. WordPress does this for you. You single-{post type}.php template should only contain the standard loop: <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); // Display post content endwhile; endif; ?>