1. Go to this page and download the library: Download alimir/wp-ulike library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
add_filter('wp_ulike_login_alert_template', 'wp_ulike_change_login_alert_template', 10);
function wp_ulike_change_login_alert_template(){
return '<p class="alert alert-info fade in" role="alert"><button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>Please login to your account! :)</p>';
}
if (function_exists('wp_ulike_get_post_likes')):
echo wp_ulike_get_post_likes(get_the_ID());
endif;
if (function_exists('wp_ulike_get_comment_likes')):
echo wp_ulike_get_comment_likes(get_comment_ID());
endif;
/**
* Get most liked posts in query
*
* @param integer $numberposts The number of items
* @param array|string $post_type Select post type
* @param string $method keep this as default value (post, comment, activity, topic)
* @param string $period Date period (all|today|yeterday|week|month|year)
* @param string $status Log status (like|unlike|dislike|undislike)
* @return WP_Post[]|int[] Array of post objects or post IDs.
*/
$wp_query = wp_ulike_get_most_liked_posts( 10, array( 'post' ), 'post', 'all', 'like' );
define( 'WP_MEMORY_LIMIT', '256M' );
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.