woocommerce get_price_html not pulling in correct price
woocommerce get_price_html not pulling in correct price
woocommerce get_price_html not pulling in correct price
You do not need to explicitly call the post-single template, this is something wordpress is doing automagically for you based on the URL structure. For archive URLs the archive template will be “called” while for single posts the single template will be “called. There are fullbacks with the ultimate one is the index.php template. For … Read more
You said you’re in a custom loop that returns various post_types: //….. while ( $loop->have_posts() ) : $loop->the_post(); get_template_part($post->post_type,’layout’); endwhile; in this way you don’t use extra conditionals and relying on get_template_part() you simply need different files post_type1-layout.php , post_type2-layout.php, etc.. in the root folder of your theme / child theme keeping the templates separate, … Read more
Calling & display certain product category loop and pagination on the homepage
Apply an Incremental Counter in an Array Function
get_query_var( ‘tag’ ) will return you ‘tag1+tag2+tag3’ string. get_query_var( ‘tag_slug__and’ ) will return you the array of tags. So, there are two ways to achieve the goal: $args = array( ‘tag’ => get_query_var( ‘tag’ ), // string ); or $args = array( ‘tag__and’ => get_query_var( ‘tag_slug__and’ ), // array ); It remains to be seen … Read more
How do I use AJAX Query in my posts loop?
Figured it out just had to do this , the page-custom-field.php is included to shorten the code. <?php $query = new WP_Query( array( ‘pagename’ => ‘features’ ) ); ?> <?php while ( $query->have_posts() ) : $query->the_post(); ?> <?php include page-custom-field.php’ ?> <?php endwhile; ?> <?php wp_reset_postdata(); ?>
If you create your own queries for these loops, all you have to do is to use post__not_in param in these queries. This way you will exclude given post from these loops. And to get the ID of first post, just use get_posts with ‘fields’ => ‘ids’
OK, so the code does exactly what it is supposed to. In your archive.php you do this: while ( have_posts() ) : the_post(); get_template_part( ‘loops/loop’, ‘archive’ ); So for every post (both of them) you include loops/loop-archive.php file. And inside that file you don’t display only the current post from global loop, but you make … Read more