• 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

Custom Sidebar Creation – Widgets are disappearing

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 › Custom Sidebar Creation – Widgets are disappearing

This topic is: not resolved

Tagged: custom sidebar, widgets

  • This topic has 4 replies, 2 voices, and was last updated 8 years, 11 months ago by David Chu.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • April 10, 2014 at 3:10 pm #99548
    klongpayabal
    Member

    I am using Genesis with the News Pro Child theme.

    I'm trying to add some additional functionality to this theme. I added an
    additional widget to the functions.php file. Code is:

    genesis_register_sidebar( array(
    'id' => 'kd-secondary-menu',
    'name' => __( 'Secondary Menus', 'news' ),
    'description' => __( 'Place Custom Menu Widgets here and use widget logic
    to change out the secondary menu.', 'news' ), 'before_widget' => '',
    'after_widget' => '',
    ) );
    I added that right after the after-entry register sidebar code. The
    sidebar shows up in the backend, but whenever I add any widgets to this,
    they don't stay. I see them there and I can edit and tweak them, but if I
    leave the widget page or reload it, the widgets are gone from that area.
    I've looked at my code and everything looks good, so I'm not sure what the
    issue could be.

    I tried using just the regular "register_sidebar" code, but that had the
    same effect. I did have "widget logic" plugin installed, and then I
    removed it, but neither one fixed the issue.

    I disabled all plugins, but the issue persisted. Anyone have any ideas on this?

    April 10, 2014 at 5:02 pm #99556
    David Chu
    Participant

    Hi,
    I tested your code, and it works fine on my test system. I didn't change my theme to show it, but my widgets I put in and played with worked fine. You even have the courteous translation bits in there. ๐Ÿ™‚

    That's a mystery, the only idea that comes to mind is that maybe the "before widget" and "after widget" areas want single quotes instead of double quotes. I did make that change when I tested. But I realize that this might be this forum's normal text butchering, not your actual code. ๐Ÿ™‚

    Dave


    Dave Chu ยท Custom WordPress Developer – likes collaborating with Designers

    April 10, 2014 at 5:07 pm #99557
    klongpayabal
    Member

    The sidebar shows up in the Appearance > Widgets. But when I add a widget to it and go away and come back, that widget is gone.

    April 10, 2014 at 5:42 pm #99560
    klongpayabal
    Member

    Let me add a little bit more that I just realized. Apparently, all the widgets I am adding are going into the "inactive widgets" section when I navigate away from the widget page. It's almost like the widgets don't recognize the sidebar id or something.

    Maybe that can spur some thoughts or ideas?

    April 11, 2014 at 6:58 am #99638
    David Chu
    Participant

    Yes, I realize that it goes away when you navigate away. But your code works for me when I navigate there and back. So I have no suggestions for the code itself.

    It's possible that something else in your theme is conflicting with it. You could, I suppose, try making a simpler widget declaration than that and see if the same thing happens. If so, then I'll vote for a theme conflict somewhere. You could also try placing your declaration in another part of your functions.php. That's all I can suggest without an investigation.

    Good luck, Dave


    Dave Chu ยท Custom WordPress Developer – likes collaborating with Designers

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 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

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