• Resolved stereozeitgeist

    (@stereozeitgeist)


    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?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter stereozeitgeist

    (@stereozeitgeist)

    Yeah I’ve somehow bonked my functions file and going back to the original setting didn’t fix it either.

    https://pastebin.ca/1823383

    I’ve pastebinned it if anyone’s kind enough to take a look at it, my eyes hurt so I’m probably not thinking clearly.

    Thread Starter stereozeitgeist

    (@stereozeitgeist)

    All right, I’ve debonked my page, but I’m still stuck : trying to give unique after_widget attributes to individual widgets. I’ll keep looking…

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘conditionally display after_widget code?’ is closed to new replies.