This topic has 4 replies, 2 voices, and was last updated 9 years by Laura.

  • Author
  • #48167
     SKS
    Participant

    Hi!
    How can I put these or some of these items (in the screendhot) in the header?

    Attachments:
    You must be logged in to view attached files.
    #48220
     Laura
    Moderator

    Hello, those are fontello icons, can be hanged with css, here is a list of the classes to change those icons, you will find fontello icons included in kleo in your documentation assets/css/fontello.css
    Activity

    COPY CODE
    
    #buddypress div#item-nav ul #activity-personal-li a:before, #buddypress div#item-nav ul #home-groups-li a:before {
    content: "\e8ed";
    }
    

    Profile

    COPY CODE
    
    #buddypress div#item-nav ul #xprofile-personal-li a:before {
    content: "\e98e";
    }
    

    Notifications

    COPY CODE
    
    #buddypress div#item-nav ul #notifications-personal-li a:before {
    content: "\e863";
    }
    

    Messages

    COPY CODE
    
    #buddypress div#item-nav ul #messages-personal-li a:before {
    content: "\e98c";
    }
    

    Friends

    COPY CODE
    
    #buddypress div#item-nav ul #friends-personal-li a:before {
    content: "\e98f";
    }
    

    Settings

    COPY CODE
    
    #buddypress div#item-nav ul #settings-personal-li a:before, #buddypress div#item-nav ul #admin-groups-li a:before {
    content: "\e98b";
    }
    

    You can share an user account of your website with me so i can give you the other icons classes 🙂

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #48286
     SKS
    Participant

    Hi Laura!

    I dont want to change the icons, I want to change their locations. I need them in the HEADER of the theme. Right now they are below the cover image of a profile.

    Thanks

    #48289
     SKS
    Participant

    Here’s the screenshot:

    I want to put these in the header

    Attachments:
    You must be logged in to view attached files.
    #48484
     Laura
    Moderator

    Hello 🙂 Sorry for the confusion.
    Those links are generated dynamically, so you cannot just make an url to them, but with this function, you can add an empty page in Pages, with each sections name (Activity, Profile, Notifications, Messages, Friends, Groups, Media, Settings) And you can also add extra with a simple change.
    Here it is:
    Add this to functions.php in child theme
    Create a new page with each section name , for example page Profile, page Messages…

    COPY CODE
    
    function redirect2profile(){
    	include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
    	if($_SERVER['REQUEST_URI'] == '/profile/' && is_plugin_active('buddypress/bp-loader.php') && is_user_logged_in()){
    		global $current_user;
    		wp_redirect( get_bloginfo('url') . '/members/'. $current_user->user_login . '/profile/'); 
    		exit();
    	}
    	if($_SERVER['REQUEST_URI'] == '/activity/' && is_plugin_active('buddypress/bp-loader.php') && is_user_logged_in()){
    		global $current_user;
    		wp_redirect( get_bloginfo('url') . '/members/'. $current_user->user_login . '/activity/'); 
    		exit();
    	}
    	if($_SERVER['REQUEST_URI'] == '/messages/' && is_plugin_active('buddypress/bp-loader.php') && is_user_logged_in()){
    		global $current_user;
    		wp_redirect( get_bloginfo('url') . '/members/'. $current_user->user_login . '/messages/'); 
    		exit();
    	}
    	if($_SERVER['REQUEST_URI'] == '/notifications/' && is_plugin_active('buddypress/bp-loader.php') && is_user_logged_in()){
    		global $current_user;
    		wp_redirect( get_bloginfo('url') . '/members/'. $current_user->user_login . '/notifications/'); 
    		exit();
    	}
    	if($_SERVER['REQUEST_URI'] == '/friends/' && is_plugin_active('buddypress/bp-loader.php') && is_user_logged_in()){
    		global $current_user;
    		wp_redirect( get_bloginfo('url') . '/members/'. $current_user->user_login . '/friends/'); 
    		exit();
    	}
    	if($_SERVER['REQUEST_URI'] == '/groups/' && is_plugin_active('buddypress/bp-loader.php') && is_user_logged_in()){
    		global $current_user;
    		wp_redirect( get_bloginfo('url') . '/members/'. $current_user->user_login . '/groups/'); 
    		exit();
    	}
    	if($_SERVER['REQUEST_URI'] == '/media/' && is_plugin_active('buddypress/bp-loader.php') && is_user_logged_in()){
    		global $current_user;
    		wp_redirect( get_bloginfo('url') . '/members/'. $current_user->user_login . '/media/'); 
    		exit();
    	}
    	if($_SERVER['REQUEST_URI'] == '/settings/' && is_plugin_active('buddypress/bp-loader.php') && is_user_logged_in()){
    		global $current_user;
    		wp_redirect( get_bloginfo('url') . '/members/'. $current_user->user_login . '/settings/'); 
    		exit();
    	}
     }
    add_action('init', 'redirect2profile');
    

    This functions makes a redirect to those profile parts if a page has the name of it, you can change it as you want, for example:

    COPY CODE
    
    	if($_SERVER['REQUEST_URI'] == '/settings/' && is_plugin_active('buddypress/bp-loader.php') && is_user_logged_in()){
    		global $current_user;
    		wp_redirect( get_bloginfo('url') . '/members/'. $current_user->user_login . '/settings/'); 
    		exit();
    	}
    

    This makes that the page that has the slug “settings” will redirect to the logged in user “settings” page.
    Just create empty pages for each link and place them in your menu, if you dont want to show those links to not logged in users, use the plugin attached, it lets you have a dinamic menu for logged in/out users

    To add more links like “sites” just paste the sample code before the last } of the above code and change the name of the slugs.

    SAMPLE CODE

    COPY CODE
    
    	if($_SERVER['REQUEST_URI'] == '/EMPTY-PAGE-SLUG/' && is_plugin_active('buddypress/bp-loader.php') && is_user_logged_in()){
    		global $current_user;
    		wp_redirect( get_bloginfo('url') . '/members/'. $current_user->user_login . '/BUDDYPRESS-URL-SLUG/'); 
    		exit();
    	}
    

    To add icons to your new menu links, you can go to Appearance > Menu and choose an icon for them

    Or you can use this plugin for already made buddypress menu links but on sidebar as a widget
    https://wordpress.org/plugins/buddypress-custom-profile-menu/

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    Attachments:
    You must be logged in to view attached files.
Viewing 5 posts - 1 through 5 (of 5 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?