• 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 default sidebar text when sidebar is unregistered

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 › Design Tips and Tricks › How to remove default sidebar text when sidebar is unregistered

This topic is: resolved

Tagged: default, remove sidebar, Sidebar, unregister

  • This topic has 10 replies, 3 voices, and was last updated 12 years, 2 months ago by asterbird.
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • February 27, 2013 at 6:29 pm #23208
    asterbird
    Member

    Hello! I'm using AgentPress Listings on a customized AgentPress theme.

    I'm unregistered the primary and secondary sidebars with this code, but now the default text shows up:

    Primary Sidebar Widget Area

    This is the Primary Sidebar Widget Area. You can add content to this area by visiting your Widgets Panel and adding new widgets to this area.

    How do I get ride of this? I've researched it, and they say to put an empty text box in the widget. Well, when you unregister, there is not place to put the textbox anymore, and I really don't want the client to have to mess with this. I just want the primary sidebar gotten rid of altogether, since I have custom sidebars showing.

    Any help is greatly appreciated!

    February 27, 2013 at 7:20 pm #23214
    Brad Dalton
    Participant

    This should do it:

    .sidebar {
    display: none;
    }
    

    Tutorials for StudioPress Themes.

    February 27, 2013 at 8:18 pm #23222
    asterbird
    Member

    sorry, the site is here.

    The display none takes away the entire sidebar, even my custom sidebars.

     

     

    February 28, 2013 at 7:12 am #23255
    Brad Dalton
    Participant

    Where do you want to remove it exactly? Which url's?

    You can grab the class from the source code or use Firebug:

    To remove the sidebar from the url you linked to use this code:

    .page-id-330 .sidebar {
    display: none;
    }
    

    Tutorials for StudioPress Themes.

    February 28, 2013 at 9:29 am #23280
    asterbird
    Member

    I would like to remove it from the apartments child pages, the properties child pages, and the contact page.

    Firebug shows that it has no special class, only the regular ones like .widget, .widget_text and .textwidget. These classes will affect my custom sidebars.

    Maybe I'm not adding my custom sidebars right. I use the genesis_register_sidebar function and then hook into the sidebar with this code:

    add_action( 'genesis_before_sidebar_widget_area', 'my_custom_sidebar' );

    function my_custom_sidebar() {

    ... my stuff...

    }

    So I want a sidebar, just not the primary sidebar...

    February 28, 2013 at 9:44 am #23284
    Brad Dalton
    Participant

    You can grab the page i.d's using Firebug or in the source code:

    .post-id-334
    .page-id-330
    .page-id-230 
    

    Why not install the Genesis Simple Sidebars plugin?

    What did you do to cause this? Warning: Illegal offset type in isset or empty in /home/sarahmo/public_html/hr/wp-includes/widgets.php on line 580


    Tutorials for StudioPress Themes.

    February 28, 2013 at 10:18 am #23299
    asterbird
    Member

    I'm not sure how grabbing the page id's will help, as the empty primary sidebar has no unique classes to grab. Using the following code will also get rid of my custom sidebars:

    .page-id-330 .widget_text { display: none; } or

    .page-id-330 .widget { display: none; }

    The warning was caused by fiddling around in my functions.php file - I fixed it.

    Maybe I should rename the primary sidebar and use it. I'm not sure how to rename it or display it only on a certain page, so that's why I was trying to get rid of it.

    February 28, 2013 at 10:35 am #23302
    asterbird
    Member

    I thought about using Genesis Simple Sidebars, but that doesn't take care of the primary sidebar. That only does the legwork for adding new/custom sidebars in the admin. Unless I missed something...

    February 28, 2013 at 10:57 am #23305
    asterbird
    Member

    Okay, I put my custom sidebars outside the #sidebar div, and now I can use display none on the #sidebar div. That works great, except for the ugly code still left in the html. Ah, well, guess I'll have to go with this.

    Thanks so much for your help, Brad!

    April 20, 2013 at 12:38 am #36515
    Jon Smith
    Member

    Hi There,

    I had a similar requirement on my site. I found the code below on http://gregrickaby.com/2011/02/genesis-code-snippets.html and thought it might help you too.

    Jon

    `
    /** Remove default sidebar */
    remove_action( 'genesis_sidebar', 'genesis_do_sidebar' );
    `

    April 30, 2013 at 1:27 pm #38615
    asterbird
    Member

    Thanks so much! That worked perfectly!!

  • Author
    Posts
Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘How to remove default sidebar text when sidebar is unregistered’ is closed to new replies.

CTA

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

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 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