• Resolved gdgraphics

    (@gdgraphics)


    Hi

    I have set up a widgitised area in a page template file, with the corresponding code in the functions file.
    The widget area shows up in the admin page for widgets alongside other widgetised areas.
    When I add a widget to my new widgetised area is doesn’t get saved. Moving away then coming back to the widgets admin page clears the widget from the widget area.
    Other widgetised areas work just fine.

    Any ideas where to look to fix this issue.

    Here is the code in the functions file:

    register_sidebars( 1,
    		array(
    			'name' => 'Home Page',
    		'id' => 'HomeDisplayRecent',
    		'before_widget' => '<div>',
    		'after_widget' => '</div>',
    		'before_title' => '<h2>',
    		'after_title' => '</h2>',
    		)
    	);

    And here is the code in the template file:

    <?php
    if ( dynamic_sidebar('HomeDisplayRecent') ) :
    else :
    ?>
    <h2>No widgets</h2>
    <?php endif; ?>

    Thanks for any help

Viewing 1 replies (of 1 total)
  • Thread Starter gdgraphics

    (@gdgraphics)

    Solved – it helps to read the forums before posting!

    Turns out that WordPress doesnt like capital letters when giving something an id.

    I changed the line:
    'id' => 'HomeDisplayRecent',
    to
    'id' => 'homedisplayrecent',
    and hey presto it works!

Viewing 1 replies (of 1 total)

The topic ‘Widgetised area not saving the widget’ is closed to new replies.