Woocommerce – remove sidebar from single product page only

  • Author
    Posts
  • #78800

    Hi,
    I’m using Nirvana. The theme has a sidebar by default in all woocommerce pages.

    We can override the behaviour of individual pages like Checkout, Cart and Account by defining a specific layout page template on that page.

    But this is not possible for the other woocommerce pages. I only want to remove the sidebar on the single product page, and not on the shop page.
    How can I do that ?

    (working with the woocommerce.php and wocommerce-nosidebar.php files will affect both the shop page AND the single product page, which is not what I want…)

    Thank you !

    Website: objet-magique.com/trouvez-votre-amulette-magique

    #78488

    Hi,

    I’m using Nirvana. The theme has a sidebar by default in all woocommerce pages.

    We can override the behaviour of individual pages like Checkout, Cart and Account by defining a specific layout page template on that page.

    But this is not possible for the other woocommerce pages. I only want to remove the sidebar on the single product page, and not on the shop page.

    How can I do that ?

    (working with the woocommerce.php and wocommerce-nosidebar.php files will affect both the shop page AND the single product page, which is not what I want…)

    Thank you !

    Website: objet-magique.com/trouvez-votre-amulette-magique

    • This reply was modified 4 years ago by Zed. Reason: moved to correct location
    • This reply was modified 4 years ago by Zed.
    #78709

    any ideas ? 🙂

    #83480
    Zed
    Cryout Creations mastermind

    If WooCommerce extends the base template hierarchy, you should be able to create a dedicated template file for a single product with which to control the layout.


    If you like our creations, help us share by rating them on WordPress.org.
    Please check the available documentation and search the forums before starting a topic.
    #83557

    What you are saying is that the layout of the single product pages depends on WooCommerce and not the theme ?

    And that there is no way I can change this layout for now ?

    #83562
    Zed
    Cryout Creations mastermind

    I mean that WordPress is capable of reading the code from specific files depending on what is browsed to render the content with. If WooCommerce extends this functionality it should also be able to read a specific file bearing a particular name (when it exists) to target a specific WooCommerce section.

    I see some information about the procedure and filename here:
    https://wordpress.stackexchange.com/questions/190335/woocommerce-change-template-for-single-product-page

    You’d need to merge code from both WooCommerce’s template and the theme’s files to ensure the correct markup as needed by the theme is present.

    Otherwise, the theme will use instruct WordPress to render all WooCommerce site sections using the general layout (except individual static pages which can have their own custom layouts).


    If you like our creations, help us share by rating them on WordPress.org.
    Please check the available documentation and search the forums before starting a topic.
    #83628

    Than you for your answer

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

The topic ‘Woocommerce – remove sidebar from single product page only’ is closed to new replies.