conditionally display after_widget code?
-
So currently I have a sidebar that’s set up like this:
if ( function_exists(‘register_sidebar’) )
{
register_sidebar(array(
‘before_widget’ => ‘<div id=”%1$s” class=”widget %2$s”><div class=”inside”>’,
‘after_widget’ => ‘<div class=”more”>+ More</div></div>/div>’,
‘before_title’ => ‘<h3>’,
‘after_title’ => ‘</h3>’,
));
}but I’ve got the idea that I’ll exclude the <more> div on one of my sidebars (inphp_w3devil_com-3). So I’ve done some reading and I think this should work –
if ( function_exists(‘register_sidebar’) )
{
register_sidebar(array(
‘before_widget’ => ”,
‘after_widget’ => $output = “”;
if(name==’inphp_w3devil_com-3′) $output .= “</div></div>”; else $output .= “<div class=”more”>+ More</div></div>/div>”;
‘before_title’ => ‘<h3>’,
‘after_title’ => ‘</h3>’,
));
return $output;}
But this gives me a TString error. Can anyone who’s more experienced with PHP lend a fresh pair of eyes to this? Please?
- The topic ‘conditionally display after_widget code?’ is closed to new replies.