View Full Version : "Most Liked" from category & API call

02-14-2016, 10:09 PM
Hi there,
I am having issues trying to achieve two functions of the plugin on a Wordpress install.

I have set up the plugin and configured all of the settings etc... but I need to find a way to achieve two things:

1. I need to display "Most liked" for each category (on a custom post type) on my site.

What would be the best way to pull out the top 3 most liked businesses for EACH category? How can I acheive this?

2. This one is even more trickier, this directory is going to be hosted on a subdomain at directory.website.com. The main website will link to this and vice-versa. However, on the main website, I need to add a sidebar that displays "Most liked businesses". This doesn't need to be category specific, however I need to display the most liked businesses on a completely seperate Wordpress install. I was looking into the API and see I can pull the data out via HTML, CSV or JSON. However, the identifier is using the page-url, when I pull this data out, it displays the page url as the title, I need it to display the title and possibly an image. Is this possible? How can I acheive this?

If you can help me out, I would greatly appreciate it!


02-15-2016, 07:00 AM

Instructions sent in response to your email to support.

02-15-2016, 11:51 AM
Yes, many thanks for that.

Although i'm not sure you have understood me completely.

1. Thank you for adding the 'Include items by category' option. However, I need to dynamically pull out the most liked based on the current category, not by specifying an ID.

2. Will doing this pull out the 'title' for the post and not just the 'identifier'?


02-15-2016, 01:12 PM
1. Most liked widget is not supporting such feature for now.

2. It will pull posts titles if you do the following: add your main domain to your account on https://likebtn.com/en/customer.php/websites then add a subdomain to this website. Enter account data on the Settings tab of the plugin. Configure the Most liked content widget on the subdomain to display all the posts.

02-15-2016, 03:51 PM
Thank you.

Regarding the 'most liked' for the category pages.

Is there any possible way to pull in the category id into the new "include categories"? Through the use of PHP, is there any way to replicate the shortcode output? This way I can possibly pull out the ID into the include category option.

02-16-2016, 07:29 AM
You can get category using the following code:

$categories = get_the_category();
$category_id = $categories[0]->cat_ID;