-
Henry replied to the topic [Resolved] Link to authors posts in members_header in the forum How-to & Troubleshooting 11 years ago
When viewing a member’s profile page, you can use
bp_displayed_user_id()
to get the ID of the member. This will then let you display a list of their posts or their latest post. e.g.$my_query = new WP_Query( 'author=' . bp_displayed_user_id() );
if ( $my_query->have_posts() ) {
while ( $my_query->have_posts() )…[Read more] -
Henry replied to the topic User Reputation/Kudos Plugin?? in the forum Third Party Plugins 11 years ago
Do you mean something like Achievements by Paul Gibbs?
-
Henry replied to the topic Can't figure out how to override parent css in the forum How-to & Troubleshooting 11 years ago
@poetrybyjade no problem. Might be worth trying again at some point though. I just tested and it works for me.
-
Henry replied to the topic Can't figure out how to override parent css in the forum How-to & Troubleshooting 11 years ago
@poetrybyjade yes, following the instructions in the article, that is exactly what I would do. Did it work?
-
Henry replied to the topic Can't figure out how to override parent css in the forum How-to & Troubleshooting 11 years ago
You need to start with an empty functions.php file in your child theme folder.
e.g.
<?php
// put whatever you want here
?>
-
Henry replied to the topic [Resolved] Link to authors posts in members_header in the forum How-to & Troubleshooting 11 years ago
Hi @3rdaxis,
Which author’s posts would you like to display?
-
Henry replied to the topic Can't figure out how to override parent css in the forum How-to & Troubleshooting 11 years ago
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; -
Henry replied to the topic How to get the total number of pages in the members directory? in the forum How-to & Troubleshooting 11 years ago
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 );
-
Henry replied to the topic Excluding Roles from the Member's Directory. in the forum How-to & Troubleshooting 11 years ago
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:
-
Henry replied to the topic How to get the total number of pages in the members directory? in the forum How-to & Troubleshooting 11 years ago
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 )
-
Henry replied to the topic How to get total private message count? in the forum How-to & Troubleshooting 11 years ago
Got it, if anyone ever needs this:
global $messages_template;
$total = $messages_template->total_thread_count;
-
Henry started the topic How to get total private message count? in the forum How-to & Troubleshooting 11 years ago
How can I get the total private message count for
sent messages
received messagesAny help would be much appreciated.
-
Henry replied to the topic Avatar-less in the forum Installing BuddyPress 11 years ago
Try adding this to your theme’s style.CSS document
.avatar {
display: none;
} -
Henry started the topic How to get the total number of pages in the members directory? in the forum How-to & Troubleshooting 11 years, 1 month ago
The members directory is split into pages. For example, the first 20 members are displayed on page 1, the second 20 members are displayed on page 2, and so on.
So, on a site which has 112 members, I would expect there to be a total of 6 pages. This will obviously change as new members join the site.
Is there a way to get the total number of pages?
-
Henry started the topic Using search_terms to manipulate members loop in the forum How-to & Troubleshooting 11 years, 1 month ago
I am trying to manipulate the data returned by the members loop and am having trouble with the pagination when clicking on page 2, page 3 when a search value is provided.
When I click on page 2, the results seem to forget the results returned by the search query and display all members.
Why is it that this works (note I have hard coded the…[Read more]
-
Henry started the topic Is there a load more button on the members directory? in the forum How-to & Troubleshooting 11 years, 1 month ago
Is there a ‘load more’ button I can use in the members directory? I know the activity feed has one.
I currently have paginated links in place but would like to replace them with the load more functionality.
-
Henry replied to the topic Ajax load more posts on BuddyPress member profile in the forum How-to & Troubleshooting 11 years, 1 month ago
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.
-
Henry replied to the topic Ajax load more posts on BuddyPress member profile in the forum How-to & Troubleshooting 11 years, 1 month ago
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.
-
Henry replied to the topic Ajax load more posts on BuddyPress member profile in the forum How-to & Troubleshooting 11 years, 1 month ago
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(…
[Read more] -
Henry started the topic Ajax load more posts on BuddyPress member profile in the forum How-to & Troubleshooting 11 years, 1 month ago
I am using Michael Martin’s approach to load the next page of posts in WordPress via AJAX:
This approach works very well on my tag and category pages.
My aim now is to display a list of posts on each BuddyPress member’s profile page and have the next page load via AJAX.…[Read more]
- Load More
@henrywright-1
Active 9 years, 10 months ago