WordPress.org

Ready to get started?Download WordPress

Forums

WP-TopBar
[resolved] Add Option to show TopBar only to guest/loggedin users!? (5 posts)

  1. way2vet
    Member
    Posted 1 year ago #

    Hi there,

    great plugin. Good ideas! What I am interested in is if there is any option to show one topbar only to guests and one only to logged-in users. And if so, is it possible to use some php-functions in the Bar-text (e.g. get username if logged in)?

    Thank you for your effort! Keep it up!

    http://wordpress.org/extend/plugins/wp-topbar/

  2. Bob
    Member
    Plugin Author

    Posted 1 year ago #

    I have added this as a feature in the next version...

    Select how you want the TopBar to show for users. Default is to Allways show the TopBar, regardless if they are logged in:

    A. Not Logged In shows the TopBar only for users not logged in.
    B. Logged In shows the TopBar only for users logged in.
    C. Always shows the TopBar for all users, logged in or not.

    Bob

  3. Bob
    Member
    Plugin Author

    Posted 1 year ago #

    Way2vet,

    I have coded up the changes above and added a PHP option. The PHP option allows you to execute PHP code at the end of each topbar. With a bit of PHP and JavaScript, I think you can do the text replace you have listed above to put the username in the bar text. I don't have the time, though, to write that for you.

    Would you be willing to test this version for me?

    If so, send me an email (my address is in the readme.txt) and I'll send you the code.

  4. Bob
    Member
    Plugin Author

    Posted 1 year ago #

    Version 4.15 is up with the PHP option. I put a code example to modify the TopBar to add the username's to the Text.

  5. way2vet
    Member
    Posted 1 year ago #

    Thank you VERY much! Works perfectly so far and is exactly what I needed.

    Thank you!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic