Support » Plugin: Simple Page Sidebars » [Plugin: Simple Page Sidebars] change before/after_widget, before/after_title

  • Resolved Pieter Bos

    (@senlin)


    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/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Blazer Six

    (@blazersix)

    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

    Thread Starter Pieter Bos

    (@senlin)

    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.

    Thread Starter Pieter Bos

    (@senlin)

    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

    Blazer Six

    (@blazersix)

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

    Thanks,
    Brady

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: Simple Page Sidebars] change before/after_widget, before/after_title’ is closed to new replies.