• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

How to remove Primary sidebar on caetory pages only

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › How to remove Primary sidebar on caetory pages only

This topic is: not resolved

Tagged: layout

  • This topic has 3 replies, 3 voices, and was last updated 9 years, 2 months ago by Brad Dalton.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • November 14, 2016 at 4:41 am #196123
    staceychurch
    Participant

    I have a site I am developing based on Genesis Sample theme.
    I have a primary sidebar set up on main pages but I want to remove this sidebar on product pages and cateory-product pages.

    I am using Woocommerce, Geneisis Connect for Woocommerce and YITH Woocommerce catalog mode plugins

    URL is here http://angmeringframing.com/test/product-category/needlecraft/

    You will see I have the products displaying full width as I have amended functions.php withn this code

    //* Display 24 products per page. Goes in functions.php
    add_filter( 'loop_shop_per_page', create_function( '$cols', 'return 24;' ), 20 );

    and the sidebar drops down below. and to the side of this section.

    Thanks.

    http://angmeringframing.com/test/
    November 14, 2016 at 4:51 am #196124
    Victor Font
    Moderator

    You need to change the setting for the category to display full-width. You can either do this one at a time by selecting the full width option on each individual page or add the following to functions.php (http://my.studiopress.com/snippets/admin-management/#force-layout-settings):

    add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );

    You would need to wrap this code in a conditional so only the category pages are changed. https://codex.wordpress.org/Conditional_Tags


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    November 21, 2016 at 4:52 am #196408
    staceychurch
    Participant

    I have taken the easiest way and changing the page layout for each category page rather than coding the functions.php page.
    This doesn't appear to work. The page I have amended still displays the Primary sidebar and drops it down the page.
    http://angmeringframing.com/test/product-category/art/

    Not sure I am confident enough with coding the functions.php with conditional tags. I am assuming that both these do the same thing anyway or is this likely to work if I add the relevant code?

    Thanks

    November 22, 2016 at 2:04 am #196450
    Brad Dalton
    Participant

    Try this code


    Tutorials for StudioPress Themes.

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble