I have a client who wants to have the ‘smart sidebar’ load relevant posts for specific WooCommerce products. I think this could be possible if I can somehow create a widget that is called when a particular product’s page is loaded. Of course, the widget would need to load the posts I would assign to a particular category related to the WooCommerce product.
Essentially, they sell about 30 products. However, for each of the products they want to have anywhere from 3 to 6 posts load in the sidebar (depending on product).
Is this do-able?
-
This topic was modified 8 years by
cantonjester.
Actually, I figured out how to do it. The question now is: how do I make particular smart sidebars, or the modules/blocks contained within them, have the hyperlinks to the posts they contain open in new tabs/windows?
-
This reply was modified 8 years by
cantonjester.

I want to use this technique for all products, but not when the blocks are used elsewhere on the site.
What I did was to create a custom sidebar for particular WooCommerce products. Some of the products have relevant posts found elsewhere on the site. So I create a series of categories for the posts that I want to load in the relative products’ sidebar. I put a block in each of the custom sidebars (each product gets their own sidebar), and then on the product page, I call that custom sidebar.
It works fine.
I just need to now be able to have those particular blocks within those specific sidebars to launch the content behind those hyperlinks in new tabs (because the visitor is now on a product’s ‘buy now’ page).
Does this make sense?
Hello cantonjester,
If you want to open in a new tab each module title, you should add the target=”_blank” property, like this -> https://www.screencast.com/t/cpf6eDs1g
Hope this helps!
Thanks for the message!
Thank you for the reply!
A couple things:
1) How is the solution you provided going to affect *ONLY* the scenario I described? Again, I only want the functionality (hyperlink opening in new tab) to occur on the WooCommerce product page.
2) How would I affect these changes in the Child Theme, and not in the main theme files?
Hello cantonjester,
Please check the following useful tutorial here -> https://forum.tagdiv.com/the-child-theme-support-tutorial/ to find all the details for Child Theme Support. All of these tasks you should do it yourself because we cannot provide custom services at the moment, sorry!
Thanks for your understanding!