0

I have just recently tried to use the sidebar parameters (before_widget, before_title) but html tags i used inside are not working

function noorband_widget_setup(){
    register_sidebar(array('name' => 'Sidebar',
                'id' => 'sidebar-1',
                'class' => 'custom',
                'description' => 'Standard Sidebar',
                'before_widget' => '<aside id="%1$s" class="widget %2$s"',
                'after_widget' => '</aside>',
                'before-title' => '<h1 class="widget-title">',
                'after_title' => '</h1>',
         )
);

the title should be heading one but that seems like a normal text enter image description here

2
  • 1
    Have you inspected the HTML to see what tag is actually being output? Just looking at it visually won't tell you because that depends on the CSS.
    – WebElaine
    Mar 26 '18 at 13:25
  • I have not applied any style yet. and i m using the bootstrap framework
    – GullAQA
    Mar 26 '18 at 14:08
5

The issue is in your params array. There was a missing closing > in before_widget and before-title should be before_title.

Try this:

array(
    'name' => 'Sidebar',
    'id' => 'sidebar-1',
    'class' => 'custom',
    'description' => 'Standard Sidebar',
    'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    'after_widget' => '</aside>',
    'before_title' => '<h1 class="widget-title">',
    'after_title' => '</h1>',
  )

Hope it helps!

2
  • Thanks, @Welcher. The problem has been solved by your help
    – GullAQA
    Mar 26 '18 at 18:58
  • @GullAQA can you mark the answer as correct please :)
    – Welcher
    Mar 27 '18 at 12:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.