WordPress.org

Ready to get started?Download WordPress

Forums

Adding id's to sidebar widgets in functions.php made widgets disappear (1 post)

  1. llamaman
    Member
    Posted 4 years ago #

    Hello!

    Here's my problem:
    I have 13 widgetized areas on my website, each with different content. This morning, I wanted to re-organize the order in which they display, so I gave them each their own id in the "register_sidebar" function array in my functions.php file. For example, I changed this:

    register_sidebar(array(
    				"name" => "Home Page Sidebar Top",
    				"before_widget" => '<div class="widget %2$s">',
    				"after_widget" => '</div>',
    				"before_title" => '<strong class="widgetTitle">',
    				"after_title" => '</strong>'
    				));

    to this:

    register_sidebar(array(
    				"name" => "Home Page Sidebar Top",
    				"id" => "1",
    				"before_widget" => '<div class="widget %2$s">',
    				"after_widget" => '</div>',
    				"before_title" => '<strong class="widgetTitle">',
    				"after_title" => '</strong>'
    				));

    The problem is when I did this, it reset all of my widgets (i.e. it made all of my widgets disappear). I reverted back to my old functions.php file, and the widgets are still not displaying.

    Does anyone know how I might get my old widgets back?

    Thank you!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.