Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #18453

    This is a continuation of a closed post found here:

    http://www.kriesi.at/support/topic/override-sidebar-position-for-shop-pages-part-ii

    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?

    #99511

    Hey!

    All woocommerce specific conditional tags are listed here: http://wcdocs.woothemes.com/codex/theming/conditional-tags/ – eg you can try is_woocommerce() && is_search()

    Best regards,

    Peter

    #99512

    Hi Peter,

    Thank you.

    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:

    http://oboralux.com/beta/?s=scarf&post_type=product

    The correct placement left-side placement of the sidebar can be seen on another page here:

    http://oboralux.com/beta/shop-catalog/product-category/new-in/

    I can’t see any obvious difference in the code.

    #99513

    Hey!

    Try to add following code to css/custom.css:

    .template-shop.sidebar_left.content {
    float: right;
    }

    Regards,

    Peter

    #99514

    After adding “!important” to the float statement, it worked. Thank you.

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘Override Sidebar Position For Shop Pages (Part III)’ is closed to new replies.