Forum Replies Created
-
In reply to: Can't figure out how to override parent css
@poetrybyjade yes, following the instructions in the article, that is exactly what I would do. Did it work?
In reply to: Can't figure out how to override parent cssYou need to start with an empty functions.php file in your child theme folder.
e.g.
<?php // put whatever you want here ?>In reply to: [Resolved] Link to authors posts in members_headerHi @3rdaxis,
Which author’s posts would you like to display?
In reply to: Can't figure out how to override parent cssHave 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;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 );In reply to: Excluding Roles from the Member's Directory.Can’t you just pass the ids of the roles you want to
bp_has_members()usinginclude?You could get the user ids you need using
get_users()then do anarray_merge()Take a look at:
Just needed a bit of maths to get this value
$total = ( bp_get_total_member_count() / $per_page )Note,
$per_pageis whatever you’ve set in your custom members loop. I think the default is 20.Then you can do:
$pages = ceil( $total )In reply to: How to get total private message count?Got it, if anyone ever needs this:
global $messages_template; $total = $messages_template->total_thread_count;In reply to: Avatar-lessTry adding this to your theme’s style.CSS document
.avatar { display: none; }In reply to: Ajax load more posts on BuddyPress member profileI 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.
In reply to: Ajax load more posts on BuddyPress member profileA 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.
In reply to: Ajax load more posts on BuddyPress member profileOK 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?In reply to: [Resolved] Register Page as Homepage redirect issueI 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' );@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.
In reply to: Block Comments When Not FriendsYou 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.
In reply to: Updating avatar from another page.@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
In reply to: oembed for soundcloud via bbPress in group forumAre 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
sweet! thanks again for the help
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
@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…
@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/followersactually – 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…
bp_current_component
bp_current_action
bp_action_variablesmembers/user/bp_current_component/bp_current_action/bp_action_variables
So
bp_current_componentis the main nav item,bp_current_actionis the subnav item andbp_action_variablesis 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.
bp_dump()V useful thanks – just taking a look through now…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/2As 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