• andrewkro

    (@andrewkro)


    Hi,

    My client wants to put categories list in h2 tags. Right now the categories are displayed using the default wp wigdet. What should I modify to surround them with <h2> tags?

    Any help will be deeply appreciated.

    Andrew

Viewing 3 replies - 1 through 3 (of 3 total)
  • esmi

    (@esmi)

    By default, the widgets use an <h2> tag. Check the theme’s functions.php file.

    Thread Starter andrewkro

    (@andrewkro)

    Thanks do much for the tip! One quick clarification:

    In the functions.php I currently have

    register_sidebar(array(
            'before_widget' => '<li id="%1$s" class="widget %2$s">',
            'after_widget' => '</li>',
            'before_title' => '<h5 class="widgettitle">',
            'after_title' => '</h5>',

    I need to wrap individual list items in <h2> tags, so the list would look like this:

    <ul>
    <li><h2>Category1</h2></li>
    <li><h2>Category2</h2></li>
    <li><h2>Category3</h2></li>
    </ul>

    What code do I need to add?

    Thanks again for the help.

    esmi

    (@esmi)

    Try replacing the function.php code above with:

    register_sidebar(array(
            'before_widget' => '<li id="%1$s" class="widget %2$s">',
            'after_widget' => '</li>',
            'before_title' => '<h2 class="widgettitle">',
            'after_title' => '</h2>',
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘wrap categories in h2 tag’ is closed to new replies.