Also I don’t load buddypress.js in my theme.
Well that’s going to be a bit of an issue then, why are you not enqueueing the BP primary js file? This file handles a lot of BP JS functionality without wish your site experience is going to be pretty flat.
I think you need to explain your approach to your theme in respect of BP integration as I can’t really think of a good reason to not use the file, overload and modify, is an option but to leave out altogether…
There’s no real reason, other than knowing exactly what my theme is doing and what it’s outputting in each scenario. I appreciate it’s a little idiosyncratic but it’s just how I do it.
If I do let buddypress.js by default, how would I make it sing nicely with this theme which is shrouded with custom markup?
Appreciate any help offered, @hnla thank you.
You’re asking questions impossible to answer.
We can’t second guess what issues might arise when allowing BP js to run, add it back in and see what transpires, it’s a far more logical approach to see what actual issues need addressing than trying to guess at what may arise.
Take a look at this tutorial:
Load Next WordPress Posts With AJAX
It’s a good attempt at explaining how AJAX can be used to load more WordPress posts. The solution isn’t 100% perfect for you a) because it applies to WordPress posts and not BuddyPress activity items and b) the query is slightly off if a new post happens to be published between initial page load and load more button click.
*But* it should give you a good starting point to gain understanding on how AJAX *might* be used to load more items into the DOM.
The bpdevel post says you need to add 'count_total' => 'count_query'
to your bp_has_activities()
call if you want to keep pagination.
So in your activity-loop.php, try adding '&count_total=count_query'
to bp_has_activities()
.
@shanebp – You’re definitely on point about the activity changes and bbPress. If you don’t have time to create a patch on the bbPress ticket, let me know and I’ll do it.
@r-a-y – Thanks for the patch.
And sorry to everyone else re these hijack posts.