The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

First widget with unique div style (2 posts)

  1. Gareth_Roberts
    Posted 4 years ago #

    Is it possible to add something like 'before_first_widget' with functions.php?
    I need to give the first widget of each page a different style to the second. I've spent days on this with no joy!

    This is my current code. I can add a '1' to my div but this is global and it's only needed on the second div. Help please!!

    for($i =0; $i <2; $i++)
    if ( function_exists('register_sidebar') )
    'name' => 'Sidebar',
    'before_widget' => '<div id="box'.++$i.'">',
    'after_widget' => '</div>',
    'before_title' => '<h2>',
    'after_title' => '</h2>',

  2. keesiemeijer
    Posted 4 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic