Skip to:
Content
Pages
Categories
Search
Top
Bottom

Using header cover

  • Hey team!

    Im wondering how can I use the cover of a profile this part: Cover
    And in the bellow part i want to post any other information that i like.

    How can I do that?

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

  • Venutius
    Moderator

    @venutius

    Search the documentation for info relating to cover images. this page talks about the function that calls the cover image:

    Using BuddyPress Cover Images inside the Member and Group Loops


    Venutius
    Moderator

    @venutius

    Also check out the overload files, I believe buddypress/members/single/cover-image-header.php is the page that fires to create the cover image, so you could use that as a basis for some custom code I reckon.

    Can you point me to a guide for noobs?
    I dont know much of buddypress and its structure.
    BUt would like it get to know.


    Venutius
    Moderator

    @venutius

    This page explains about template overloads, but really you are not looking to do that, just view the contents of wp-content/buddypress/bp-templates/bp-legacy/buddypress/members/single/coer-image-header.

    You are looking to display the cover based header info and this is the page that does that in BP. However one thing to note is that these functions will only work in a BP profile page since they are using displayed username to identify the cover info to publish. So I guess this depends on what page you are looking to publish this info on?

    An alternative I looked at is to use the BuddyPress Profile Shortcodes plugin, but unfortunately this does not include a shortcode for the cover image, most of the other information you re after though, they can get.


    Venutius
    Moderator

    @venutius

    VapVarun has suggested some code that would return the url for the members cover image, you could use this as a basis for developing some code?

    $args = array(
    
    				'object_dir' => 'members',
    
    				'item_id'	 => $user_id	 = bp_get_member_user_id(),
    
    				'type'		 => 'cover-image',
    
    			);
    
    $cover_img_url	 = bp_attachments_get_attachment( 'url', $args );
    
    <img src="' . $cover_img_url . '" />

    Venutius
    Moderator

    @venutius

    If you want to get to know the structure of the BP overload files, could I suggest you try installing https://wordpress.org/plugins/bp-template-overloader/ this maps out all of the overload files, it’s pretty daunting the sheer number of files you can modify, but if you look for that one file you can view it’s contents.

    Also the link I mentioned but forgot to include about overloading BP is here. https://codex.buddypress.org/themes/theme-compatibility-1-7/a-quick-look-at-1-7-theme-compatibility/


    Venutius
    Moderator

    @venutius

    I think what you are looking for is the ability to place a shortcode on a page, that displays the members header on a page of your choice for any given member id.

    There isn’t such a thing, however https://wordpress.org/plugins/buddypress-profile-shortcodes/ comes close in that it allows you to display most of the components of the members header on a page.

    BuddyPress Profile shortcodes is a pretty simple plugin, I think it should be possible to combine VapVarun’s contributed code with BP Profile Shortcodes in order to create a shortcode that does something similar to what you are looking for.


    Venutius
    Moderator

    @venutius

    OK I’ve added the ability to display cover images to the shortcode. I’ve emailed the plugin author to see if they will accept my contribution.

    However, that does not give you exactly what you need: A fully formatted copy of that individuals profile header – integrating user name, cover image, avatar etc.

    For that I think a much bigger fork in the plugin would be required. However this gives you the components, you could create the layout that you need using css I reckon.


    Venutius
    Moderator

    @venutius

    Hi Jorge,

    The header functionality is now available in a new plugin I’ve created. It should make it a lot easier for you to display both group and user headers:

    BP Profile Shortcodes Extra

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.
Skip to toolbar