WordPress.org

Ready to get started?Download WordPress

Forums

Menubar
[resolved] Making Menubar aware of 'current page' via php? (3 posts)

  1. perywinkle
    Member
    Posted 3 years ago #

    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

  2. Andrea Tarantini
    Member
    Plugin Author

    Posted 3 years ago #

    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!

  3. perywinkle
    Member
    Posted 3 years ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags