I’m using the activity shortcode plugin, and I wanted to make an edit to the plugin so it uses the ‘load more’ button instead of the standard pagination links, I removed this section:
<?php if( $pagination ):?> <div class="pagination"> <div class="pag-count"><?php bp_activity_pagination_count(); ?></div> <div class="pagination-links"><?php bp_activity_pagination_links(); ?></div> </div> <?php endif;?>
and added this just after the endwhile (just like in buddypress/activity/activity-loop.php):
<?php if ( bp_activity_has_more_items() ) : ?> <li class="load-more"> <a href="<?php bp_activity_load_more_link() ?>"> <?php _e( 'Load More', 'buddypress' ); ?> </a> </li> <?php endif; ?>
It doesn’t work correctly though. It loads more items when you click the load more button, but it ignores the shortcode parameters and uses Buddypress’s default parameters.
Do you know how I can make this work correctly?
Any help appreciated.
- Brajesh Singh on March 19, 2016 at 12:56 pm #3093
The above code relies on the default implementation of load more and that’s why it is happening.
You will need to supply your own js code for load more only then it will work properly. A look at the buddypress.js file and how BuddyPress loads the older activity will certainly help.
Please take a look and let me know if you need any assistance further.
Thanks, I will take a look at that file to see if I can work it out. I’m using the activity loop file for the main activity areas so the ajax load more activities works for that. The ajax load more activities would be great to work with the shortcode plugin for other areas of my website, but it’s not a big issue for me at the moment.
- This reply was modified 7 years, 2 months ago by Andy.
You must be logged in to reply to this topic.