WordPress.org

Support

Support » Plugins and Hacks » Menubar » [Resolved] Making Menubar aware of 'current page' via php?

[Resolved] Making Menubar aware of 'current page' via php?

  • Hey, I’m smitten with the Menubar plugin. Big ups!

    I’d like to use Menubar’s php function. Where if a user is logged in show them a menu. So far so good with this code:

    if (is_user_logged_in ())
    return array ('Create Event', '/event/create');
    else
    return array ('Log in to create a Event', '/login');

    Now. If i’m outside of the WP page realm, how would I make Menubar aware of the ‘current page’, as to add ‘.selected’ class to the li.

    if ( bp_is_page( 'event' ) ) : echo'<li class='selected>'…?

    Thanks!
    Mic

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Andrea Tarantini

    @dontdream

    Hi Mic,

    Try using fully qualified URLs (http://…) in your returned links, and the highlight function should work automatically. This is a bug I should fix in a future Menubar version.

    Thank you for your feedback!

    Andrea, Oh! That didn’t occur to me. Will do!
    Ya it’s been a saving grace having your plugin in the WP tool kit.
    Thanks !!

    Mic

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Making Menubar aware of 'current page' via php?’ is closed to new replies.
Skip to toolbar