Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 25 replies - 151 through 175 (of 574 total)
  • @henrywright-1

    Member

    @poetrybyjade yes, following the instructions in the article, that is exactly what I would do. Did it work?

    @henrywright-1

    Member

    You need to start with an empty functions.php file in your child theme folder.

    e.g.

    <?php
    
    // put whatever you want here
    
    ?>

    @henrywright-1

    Member

    Hi @3rdaxis,

    Which author’s posts would you like to display?

    @henrywright-1

    Member

    Have you tried doing what the article suggests? i.e putting this in your theme’s functions.php file:

    if ( !function_exists( 'bp_dtheme_enqueue_styles' ) ) :
        function bp_dtheme_enqueue_styles() {}
    endif;

    @henrywright-1

    Member

    Just found an even better way of getting the total. This will always match your loop count. e.g be correct even when member search has been used.

    global $members_template;	
    $total = ( (int)$members_template->total_member_count / 2 );
    

    @henrywright-1

    Member

    Can’t you just pass the ids of the roles you want to bp_has_members() using include?

    You could get the user ids you need using get_users() then do an array_merge()

    Take a look at:

    Members Loop

    @henrywright-1

    Member

    Just needed a bit of maths to get this value

    $total = ( bp_get_total_member_count() / $per_page )

    Note, $per_page is whatever you’ve set in your custom members loop. I think the default is 20.

    Then you can do:

    $pages = ceil( $total )

    @henrywright-1

    Member

    Got it, if anyone ever needs this:

    
    global $messages_template;
    $total = $messages_template->total_thread_count;
    
    In reply to: Avatar-less

    @henrywright-1

    Member

    Try adding this to your theme’s style.CSS document

    .avatar {
        display: none;
    }

    @henrywright-1

    Member

    I need the post list to stay updated e.g when a member updates a post, WP Query will display the updated title in the post list. With activity, the old entry will remain in the list and a new item will be written to the list as well.

    @henrywright-1

    Member

    A couple of reasons but mainly to keep everything on one page. A load more button for posts is also consistent with the activity feed load more approach.

    I was thinking the same about a fallback so I’ve added plain pagination to the page too – it gets hidden via the js so falls back nicely when js is disabled.

    @henrywright-1

    Member

    OK got it down to the built in WP function next_posts() not taking into account the current component and current action parts of the URL.

    The URL getting passed to the script is this username/page/3 whereas in BuddyPress we need username/current_component/current_action/page/3

    Now my next problem is how to modify the link returned by next_posts() to add in the additional bit of the URL?

    @henrywright-1

    Member

    @tse11

    I came across this exact same thing a few weeks back so wrote the function below:

    // redirect front page for logged in visitors
    function redirect_front_page_for_loggedin_users() {
    	global $bp;
    	// redirect only when user is logged in and we are viewing the front page as set in WP admin
    	if ( is_user_logged_in() && ( is_front_page() ) ) {
    		wp_redirect( $bp->loggedin_user->domain );
    		exit();
    	}
    }
    add_action( 'wp', 'redirect_front_page_for_loggedin_users' );

    @henrywright-1

    Member

    @hnla in the end this wasn’t a problem with the .pot file. It was a self-inflicted problem caused by messing with wp-config.php. Thanks again for your help.

    @henrywright-1

    Member

    You can do this by checking if the displayed member is friends with the logged in member and then showing the comment form conditionally.

    $status = friends_check_friendship_status( bp_loggedin_user_id(), bp_displayed_user_id() );
    if ( $status ) {
        // show comment form
    } else {
        // don't show it
    }

    Please note I’ve not tested this but that is the general approach, I think.

    @henrywright-1

    Member

    @martinbeaulne the avatar upload process uses certain scripts (jcrop etc) so you will need to check they aren’t being enqueued only on the /change-avatar/ page

    @henrywright-1

    Member

    Are you removing support for that provider (soundcloud) anywhere? if you take a look in class-oembed.php – soundcloud is supported and looks as though it has been since WP 2.9

    @henrywright-1

    Member

    sweet! thanks again for the help

    @henrywright-1

    Member

    bp_action_variables are stored as an array

    That does make it easy. you just have to ‘catch’ them right?

    so if somebody randomly entered the URL posts/page/2/3/hello and I did something like

    if ( $bp->action_variables[2] == 'hello' ) {
    // do something
    } else {
    // do nothing
    }

    then ‘do something’ would happen

    @henrywright-1

    Member

    @modemlooper got ya! I see now – perhaps the pagination needs the actions variables to be available. Hiding the subnav (but still keeping it) works.

    Thanks for all your help in this thread, appreciate it! 🙂

    Now i’m off to learn about why this blasted pagination query needs the action variables in order to work…

    @henrywright-1

    Member

    @modemlooper tried the space, it didn’t work very well for me.

    looking through BP core – i noticed every single component has a subnav set – even BP Follow has subnavs set – it’s making me think subnavs (bp_current_actions) are needed as the BP Follow subnavs are highly redundant:

    members/username/following/following
    members/username/followers/followers

    @henrywright-1

    Member

    actually – it only seems to work when a bp_current_action (subnav item) is set. strange!

    EDIT: Oh right, i’ll give the space a shot…

    @henrywright-1

    Member

    @modemlooper

    bp_current_component
    bp_current_action
    bp_action_variables

    members/user/bp_current_component/bp_current_action/bp_action_variables

    So bp_current_component is the main nav item, bp_current_action is the subnav item and bp_action_variables is what comes after that.

    bp_dump() shows me that when bp_current_action has a value, pagination works. When it doesn’t have a value (e.g. I don’t have a subnav item), although paginate_links() outputs the proper URLs, when I visit the URL I just get redirected to the members directory. It’s almost like the query doesn’t contain the post information.

    @henrywright-1

    Member

    bp_dump() V useful thanks – just taking a look through now…

    @henrywright-1

    Member

    I suppose my problem comes down to why paginated posts are only displayed when a subnav is specified.

    e.g. If I display my list of posts on page

    members/username/COMPONENT-NAME/

    then i’d want my paginated posts to display like this:

    members/username/COMPONENT-NAME/page/2

    As it stands, i’m displaying my list of posts on:

    members/username/COMPONENT-NAME/

    and my paginated posts are available like this:

    members/username/component-name/SUBPAGE/page/2

Viewing 25 replies - 151 through 175 (of 574 total)
Skip to toolbar