Modifying Activity Loop for Likebtn
-
Hope everybody is doing well.
Im having trouble using a plugin. The plugin is by likebtn.com and allows me to sort activity by most liked content. However it requires modifying a bit of code and im having quite the difficult time. I have tried pasting this line of code into a few different files. Currently im trying to paste it into ‘public_html/wp-content/plugins/buddypress/bp-activity/bp-activity-template.php’. When i try to include it into the PHP file the activity page breaks and a syntax error appears saying there was an unexpected ‘<‘ at the top of the new code. Here is where i pasted the code and the instructions provided by likebtn.comfunction bp_has_activities( $args = '' ) { global $activities_template; // Get BuddyPress. $bp = buddypress(); /* * Smart Defaults. */ //Filtering by Likes.Custom Code. <?php query_posts($query_string . '&meta_key=Likes&orderby=meta_value&meta_type=numeric&order=DESC'); ?> <?php /* Start the Loop */ ?> <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', get_post_format() ); ?> <?php endwhile; ?> // User filtering. $user_id = bp_displayed_user_id() ? bp_displayed_user_id() : false;
https://likebtn.com/en/wordpress-like-button-plugin#sort_posts_by_likes
- You must be logged in to reply to this topic.