Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1244394
    Fotkyzadarmo
    Participant

    Hello,

    First
    I would like to know if there is possibility to link author of the post to his BuddyPress profile. How could this be done?

    Im using a 3rd party pluging because I couldnt find a plugin that would show author of the post in the widget. I would like to link detected author to his buddypress profile rather than to all of his posts.

    Second
    What file do I need to change and what code to add to it to show all posts under the profile like I have it in the mockup? I want to show the search results or category archive template under the profile.

    Third and last
    How can I change the layout of the profile page to be the fullwidth instead of using a sidebar?

    Thank you 🙂

    #1244781
    Rad
    Moderator

    Hi there,

    Thanks for posting in.

    1. That’s possible, please add this code to your child theme’s functions.php

    add_filter( 'author_link', 'x_bp_author_link', 10, 3);
    function x_bp_author_link( $link, $author_id, $author_nicename ) {
    return bp_core_get_userlink( $author_id );
    }

    2. Please add this code to your child theme’s functions.php as well

    add_action('bp_after_profile_content', 'profile_custom_content', -99 );
    function profile_custom_content () {
    $author_id = bp_displayed_user_id();
    
    //Now add your code here that picks user posts and filters it by $author_id. 
    //Can be custom code or shortcode like from grid or any feature that represent posts
    
    }

    I can’t provide the exact code since X doesn’t have a feature that displays recent posts by author. The codes depends on the plugin or custom code that you wish to implement.

    3. You can switch to full-width at Admin > Appearance > Customizer > BuddyPress > Layout.

    Hope these helps.

    #1245138
    Fotkyzadarmo
    Participant
    This reply has been marked as private.
    #1245581
    Rad
    Moderator

    Hi there,

    1. Would you mind providing your site’s URL as well?

    2. What author content? The code depends on what you wish to implement.

    Thanks!

    #1245822
    Fotkyzadarmo
    Participant

    1. Sorry my bad, http://www.fotkyzadarmo.sk
    2. Author’s posts.

    #1246227
    Rad
    Moderator

    Hi there,

    1. Can’t login, it has this message

    EN
    Due to protection of web servers from repeated attacks, we were forced to restrict access to administrative interface of web pages to selected countries. If you are currently in a foreign country, please sign in to WebAdmin, proceed to your domain management and geoIP disable this filter in CMS Support section.

    2. Then it’s recent posts but filtered by author ID (hence author posts) 🙂

    How do you want to implement it? Essential Grid? The Grid? You probably need is a shortcode for complete function (eg. navigation and pagination) as the post listing can get longer.

    Let’s make a sample, let’s say you decided to use The Grid plugin, and your grid shortcode is [the_grid name="author grid"]

    Then the code will be like this,

    add_action('bp_after_profile_content', 'profile_custom_content', -99 );
    function profile_custom_content () {
    
    echo do_shortcode('[the_grid name="author grid"]');
    
    }
    function the_grid_query_args($query_args, $grid_name) {
    
    $author_id = bp_displayed_user_id();
    
        if ($grid_name == 'author grid' && $author_id > 0) {
            $query_args['author'] = $author_id;
        }
        
        return $query_args;
        
    }
    
    add_filter('tg_wp_query_args', 'the_grid_query_args', 10, 2);

    You may want to consult it to a developer as they can do improvement/enhancement that’s best suited for your mockup 🙂

    Thanks!

    #1247453
    Fotkyzadarmo
    Participant

    Ah thank you. The restriction that prevented you from login in has been turned off.

    #1250072
    Rahul
    Moderator

    Hey There,

    Thanks for writing back!

    The given WP Login Credentials doesn’t seem to be valid.

    ERROR: The username or password you entered is incorrect. Lost your password?

    Thanks for understanding!

  • <script> jQuery(function($){ $("#no-reply-1244394 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>