WordPress.org

Ready to get started?Download WordPress

Forums

Where Did My Custom Widget Content Go? (3 posts)

  1. flashbuddy
    Member
    Posted 2 years ago #

    I created a set of four widget areas in my functions.php file. Widget areas show up in my admin=>widgets

    Added code to call the widgets in the theme. Works great.

    Created a widget. It shows up in the widgets. I can drag the widget into the new widget area, add my content; works beautifully.

    Problem: When I return to the admin=>widgets page, the custom widget is no longer in the widget sidebar area.

    Screen Shot: http://awesomescreenshot.com/0fbjp1r08

  2. flashbuddy
    Member
    Posted 2 years ago #

    After extensive trouble shooting I've concluded my home grown widget is a-ok. The code calling my widget areas is a-ok.

    Problem is the widget areas in the admin won't retain any widget placed within?!

    Using:
    `if (function_exists('register_sidebar')) {
    register_sidebar(array(
    'name'=> 'Silver Info Box',
    'id' => 'catBox-2',
    'before_widget' => '<li id="%1$s" class="widget %2$s">',
    'after_widget' => '',
    'before_title' => '<h2 class="offscreen">',
    'after_title' => '</h2>',
    ));

    }'

  3. flashbuddy
    Member
    Posted 2 years ago #

    Figured it out, can you?

    Answer: The ID should be all lowercase alphanumeric characters and not contain white space. You can also use the - and _ characters.

    http://codex.wordpress.org/Function_Reference/dynamic_sidebar

Topic Closed

This topic has been closed to new replies.

About this Topic