• Hi,

    I use functions.php to help me theme a sidebar:

    <?php
    if ( function_exists('register_sidebar') )
    	register_sidebar(array(
            'before_widget' => '',
            'after_widget' => '</div></div>',
            'before_title' => '<div id="test1-header" class="accordion_headings" >',
            'after_title' => '</div><div id="test1-content"><div class="accordion_child">',
        ));
    
    ?>

    But I would like each div id to increment to allow a javascript to his job properly.

    First widget is:
    test1-header
    test1-content

    Second widget becaumes:
    test2-header
    test2-content

    Third widget becaumes:
    test3-header
    test3-content

    etc…

    How can I do this?

    Many thanks for your time and help

  • The topic ‘Increment div id in functions.php (or else) ?’ is closed to new replies.