WordPress.org

Ready to get started?Download WordPress

Forums

Simple Page Sidebars
[resolved] change before/after_widget, before/after_title (5 posts)

  1. Piet
    Member
    Posted 2 years ago #

    Hi Brady/Brody,

    I have a quick question about your WordPress plugin Simple Page Sidebars.

    As my sidebars are not coded with list items and also not with h2 headers but with h4 instead, I would like to change that in your code.

    However, the only place I can find anything in that regard is in lines 58-63 of the simple-page-sidebars.php file.

    As in that file there is no h2 either I am wondering how they can pop up in the theme as such?

    Is there any way you can shed a light on this?

    Thanks in advance!
    Piet

    http://wordpress.org/extend/plugins/simple-page-sidebars/

  2. Blazer Six
    Member
    Plugin Author

    Posted 2 years ago #

    Hi Piet,

    If you haven't made any changes to your code, the plugin should automatically use the HTML as defined when the sidebar was registered (before_widget, before_title, etc). If nothing was defined, then WordPress automatically defaults to using list items and h2 headers.

    - Brady

  3. Piet
    Member
    Posted 2 years ago #

    Hi Brady,

    Thanks for your quick response!

    I'm using a custom theme with 7 sidebar widgets already (1x header, left sidebar, right sidebar and 4x footer). I was trying to make the right sidebar the default one and have your plugin replace it depending on the page.

    My own code for this right sidebar in the function.php is:

    register_sidebar(array(
    			'name' => __('Right Sidebar', 'trasteros'),
    			'description' => __('Right Sidebar', 'trasteros'),
    			'id' => 'sidebar',
    			'before_widget' => '<div class="widget-area"><div id="%1$s" class="widget %2$s">',
    			'after_widget' => '</div></div><!-- end .widget-area -->',
    			'before_title'=>'<h4 class="widgettitle">','after_title'=>'</h4>'
    		));

    But when I activate your plugin it changes into a list item and h2. And even if I change your code to reflect my code my theme still shows the list item and h2.

  4. Piet
    Member
    Posted 2 years ago #

    OK, I think I made a mistake when registering the sidebars.

    I changed some things now and your plugin works perfect!

    Thanks so much for developing this plugin!

    Piet

  5. Blazer Six
    Member
    Plugin Author

    Posted 2 years ago #

    Great, glad to hear you got it working! And do let me know if you have any questions or suggestions.

    Thanks,
    Brady

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic