简体   繁体   中英

How to use multiple [product_page id=”101″] shortcode in a post?

I want to post 3 of my products using [product_page id=”101″] shortcode on a single post and shortcode does work properly but the problem is with the description! eg. if i use 3 product_page id shortcode on a post like

[product_page id=”101″] [product_page id=”102″] [product_page id=”103″]

But on a post it only shows description of a last product which is 103! 101 and 102 description goes blank (you need to click on description tab to see it instead of direct view) I want to show all the product description as it is on a post! How do i resolve it? Solution is heartly appreciated! Thanks!

You have to reset post data using wp_reset_postdata(); after every product details to print. and reset all your variable and check again.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM