Skip to:
Content
Pages
Categories
Search
Top
Bottom

Creating links in my sidebar


  • Tanya
    Participant

    @pjtna

    Instead of using the BuddyBar, I’d like to be able to place these links in my sidebar. For this I am using sidebar-buddypress.php. I don’t know what code to use to place the links there.

    For example, I will have a Profile link in the sidebar that will appear if a user is logged in and will link to their profile. I would also like links for Logging in/out, Messages, etc.

    I am using the latest versions of BuddyPress and WordPress.

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

  • danbpfr
    Participant

    @chouf1

    Hi @pjtna,

    There are many ways to accomplish what you want, depending essentially of your php/html knowledge.
    First thing you have to do anyway is to create a child theme.

    Second, IMO, the easiest would be to create a widget with help of the TextWidget delivered with WP and phpexec plugin. This plugin allows to insert php, css and HTML into the TextWidget. No need then to hack into the sidebar file.

    Note: you can search on this forum with Google. Use `buddypress.org: your search terms`
    This would bring you many answers.
    And apologize if I push an opened door ;-)


    Tanya
    Participant

    @pjtna

    Hi @Chouf1,

    I have been googling for the past 2 hours, so I thought I might finally give the forums a go.

    I am already using my own theme – I have my sidebar-buddypress.php ready to insert code I need to add these links. Once I have the links I’m ok with styling it. I don’t think I need to set up a widget as I can directly edit the php file in Coda.

    The problem is, I don’t know what the code is and that is what I’m looking for.

    Hope that clarifies it a bit more.


    danbpfr
    Participant

    @chouf1

    OK i see what you mean.
    Adminbar menus are Core stuff, so it’s a bit tricky (and not recommend) to work on directly.
    Can you list the items you want in your sidebar ? Would be easier to have them for help concretly.

    Have a glance here:
    http://tinyurl.com/pedoazz


    Tanya
    Participant

    @pjtna

    Ok, so I found this via some more google searching: http://halfelf.org/2011/customizing-sidebar-profile-bp/

    The code has a few errors on there, but I managed to fix up the Profile links. At the moment, I have:

    Hello, Username
    – Profile
    – Edit Profile
    – Edit Settings

    where Profile, Edit Profile and Edit Settings are links for that user.

    This is the code I am using and it looks to be working well:

    <strong>Hello, </strong>
    <li><a href=&quot;profile/">Profile</a>
    </li>
    <li><a href=&quot;profile/edit/">Edit Profile</a>
    </li>
    <li><a href=&quot;settings/">Edit Settings</a>
    </li>

    I am now working on the “Notifications”, e.g. Messages, Compose, Sent. I managed to figure out the “Messages” link.

     0 ) { ?>
    <a href=&quot;" rel="nofollow">">Inbox ()</a><?php
    } else {
    ?><a href=&quot;/messages/" rel="nofollow">No new messages</a>

    So now I just need “Compose” and “Sent”


    danbpfr
    Participant

    @chouf1

    Do you know this plugin ? https://wordpress.org/extend/plugins/buddybar-widget/
    Maybe for inspiration at least… ;-)


    Tanya
    Participant

    @pjtna

    Ok, so there was a slight error in the above code for the ‘Messages’. If anyone is interested in the link, here is the code I have used for Messages, which shows how many messages you have unread like Messages (2), or leaves it at Messages (0) if you have no messages.

    <li> 0 ) { ?>
    <a href=&quot;/messages/" rel="nofollow">Messages ()</a><?php
    } else {
    ?><a href=&quot;/messages/" rel="nofollow">Messages (0)</a></li>

    I have also done the links for ‘Compose’ and ‘Sent’:

    <li><a href=&quot;/messages/compose/">Compose</a></li>
    <li><a href=&quot;/messages/sentbox/">Sent</a></li>
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Creating links in my sidebar’ is closed to new replies.
Skip to toolbar