If you have troubles since the update to WordPress 4.5 please read this post before opening a new thread.
December 7, 2012 at 12:52 am #18453
This is a continuation of a closed post found here:
The solution described in the previous post (Part II) worked well to force a left sidebar on shop product category pages when the theme’s default sidebar is right.
The solution worked by detecting that the user is on a product category page using is_product_category() and then forcing the left sidebar accordingly.
Unfortunately, this solution is not working on the shop product search results page because the system is correctly detecting that the user is NOT on a product category page and so the default right sidebar is shown.
My question is: how can I detect that the user is on the shop product search results page so that I can force a left sidebar for this page as well? Is there a function like is_product_search() that I can also test for?December 7, 2012 at 7:36 am #99511
All woocommerce specific conditional tags are listed here: http://wcdocs.woothemes.com/codex/theming/conditional-tags/ – eg you can try is_woocommerce() && is_search()
PeterDecember 7, 2012 at 12:17 pm #99512
The combination of is_woocommerce() and is_search() did not work. However, removing is_search() and only checking for is_woocommerce() did force the correct class to be added to the Div (e.g. sidebar_left). Unfortunately, despite that we are now including the correct class, the sidebar is still appearing on the right. Can’t understand why.
Perhaps you could take a look here:
The correct placement left-side placement of the sidebar can be seen on another page here:
I can’t see any obvious difference in the code.December 7, 2012 at 6:44 pm #99513
Try to add following code to css/custom.css:
PeterDecember 8, 2012 at 4:21 pm #99514
The topic ‘Override Sidebar Position For Shop Pages (Part III)’ is closed to new replies.