Woocommerce: Post above products pages
-
Hello.
I would like to include content from a post displayed above my products pages.
I put the following code into my archive-product.php file, which I copied into my child-theme (using Twenty Twelve).
<?php global $more; $more = 0; query_posts('cat=37'); if(have_posts()) : while(have_posts()) :the_post(); ?> <h2><a>"><?php the_title();?></a></h2> <div><?php the_content('Read More') ?></div> <?php endwhile; endif; wp_reset_query();?>
[Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]
As you know, this is displaying the content of the post from a particular category.
But here is the issue.
I want each of my product pages to display content from a different post/different category.
Could you please let me know if there is a way to do this.
I thought I could duplicate the archive-product page for each category (Mens, Shoes, Boots etc.) and just change the code above to suit… but I presume that is not efficient or even possible.
Thanks
Joe
- The topic ‘Woocommerce: Post above products pages’ is closed to new replies.