Skip to:
Content
Pages
Categories
Search
Top
Bottom

Create link to friends activity?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Avatar of danbp
    danbp
    Moderator

    @danbp

    Hi @adjunkten,

    Yes ! But you cannot use a variable (current user) in a ordinary menu. So the question is,
    where do you need this menu ?

    Avatar of Adjunkten
    Adjunkten
    Participant

    @adjunkten

    Cheers,

    I would like it to be in the topmenu of my site, when a user is logged in.

    In the wordpress menu settings I can link to buddypress ‘activity’ – which uses a variable – so why not friends activity which resembles FB’s start page?

    Avatar of danbp
    danbp
    Moderator

    @danbp

    In the menu settings you can link to the activity page, not to a specific activity (so far i know).

    I posted 3 snippets on Github to test and choose what you need/prefer to use.

    Copy/paste the code into bp-custom.php

    Avatar of Adjunkten
    Adjunkten
    Participant

    @adjunkten

    Thanks danbp! Exactly what I was looking for.
    And my first experience bp-custom.php .

    I would prefer the last option with a link in the wp menu bar next to ‘log ind’ in the top right: My site

    – the only problem is, that the rest of my menu items disappear when I use that snippet.

    Can you fix that?

    Avatar of wp_maybe
    wp_maybe
    Participant

    @wp_maybe

    I read another solution here

    1. Install and activate this plugin http://wordpress.org/plugins/wp-exec-php/

    2. Create a new page called “Friends” or whatever name you want and add it to your menu.

    3. In content of this page, add this code

    <meta http-equiv=”refresh” content=”0;URL=http://blabla.com/members/<?php global $current_user;
    get_currentuserinfo();

    echo sanitize_file_name($current_user->user_login). “”;

    ?>/activity/friends/”>

    4. You may still need a way to hide this menu from logged out users. Plugin http://wordpress.org/plugins/if-menu/

    Avatar of Adjunkten
    Adjunkten
    Participant

    @adjunkten

    Thanks a lot.

    Maybe a little over the top to install to new plugins… Afterall, danbp’s code works from the top wp menu.

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

You must be logged in to reply to this topic.