Skip to:
Content
Pages
Categories
Search
Top
Bottom

buddybar menu add-ons

Viewing 7 replies - 1 through 7 (of 7 total)
  • Avatar of maburker
    maburker
    Participant

    @maburker

    I am looking to do the same thing, if you find a solution then please let me know:)

    Avatar of Boone Gorges
    Boone Gorges
    Keymaster

    @boonebgorges

    Wrap a button in if ( is_user_logged_in() ) { and }. Only logged in users will see it.

    Avatar of bpisimone
    bpisimone
    Participant

    @bpisimone

    Hey Boone, is there a way to do something like if a logged in user clicks the button he goes to /blabla and if a guest clicks the button he goes to /registerfirst?

    Avatar of r-a-y
    r-a-y
    Moderator

    @r-a-y

    Add an else statement to the code Boone posted.

    <?php if(is_user_logged_in()) : ?>
    <a href="LINK TO WHERE YOU WANT THE LOGGED IN USER TO GO"><img src="YOUR BUTTON" alt="" /></a>
    <?php else : ?>
    <a href="LINK TO WHERE YOU WANT PEOPLE WHO ARE NOT LOGGED IN TO GO"><img src="YOUR BUTTON" alt="" /></a>
    <?php endif; ?>

    Sorry for the caps! ;)

    Avatar of bpisimone
    bpisimone
    Participant

    @bpisimone

    Thanks r-a-y!

    Avatar of maburker
    maburker
    Participant

    @maburker

    They might work for a button but, what about a function like so……

    //*********Site Navigation*********//

    function site_nav_links(){ ?>

  • Explore

    <ul class=”your-ul-list-css-classname”>

  • Blog
  • Members
  • <li class=”alt”>Groups

  • Forums
  • <li class=”alt”>Blogs

    <?php

    }

    I tried a hundred ways and all I get is a white screen. I am not sure if I am writing the loggin user part correctly or not. The above function works well for the public but, once you try to hide it from the public it goes blank. I have almost given up.

Avatar of r-a-y
r-a-y
Moderator

@r-a-y

Use backticks to add code, or better yet, use pastebin.com

Viewing 7 replies - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.