Skip to:
Content
Pages
Categories
Search
Top
Bottom

buddybar menu add-ons

Viewing 6 replies - 1 through 6 (of 6 total)
  • Profile photo of maburker
    maburker
    Participant

    @maburker

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

    Profile photo of Boone Gorges
    Boone Gorges
    Keymaster

    @boonebgorges

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

    Profile photo 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?

    Profile photo 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! ;)

    Profile photo of bpisimone
    bpisimone
    Participant

    @bpisimone

    Thanks r-a-y!

    Profile photo 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.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘buddybar menu add-ons’ is closed to new replies.