Navigation überspringen

[Gelöst] Show number of likes in view, sort by likes

Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.

Problem:
The customer asked how to sort the view's results by the number of likes.

Solution:
Guided to select the custom field that the likes plugin use in the view's order by settings.

Relevant Documentation:
https://likebtn.com/en/wordpress-like-button-plugin#sort_posts_by_likes

This support ticket is created vor 4 years, 3 months. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Zeitzone des Unterstützers: Asia/Karachi (GMT+05:00)

Dieses Thema enthält 3 Antworten, hat 3 Stimmen.

Zuletzt aktualisiert von juttaB vor 4 years, 3 months.

Assistiert von: Waqar.

Author
Artikel
#2292229
Bildschirmfoto 2022-02-14 um 20.49.17.png

Tell us what you are trying to do?
I have created a view, which should show some post content and the number of likes and I am trying to sort the view by likes, unfortunately it does not work, as I have no clue how to name the like field. Do you have any idea how to find that out? I thought it would be "Like" as I can use this in the filter, but it dies not word.
I use the plugin likeBtn, but I can use whatever you suggest.

What is the link to your site?
versteckter Link

You should still have the login cress to the page - or is it safe to upload it here?

Regards and thanks

#2292545

Nigel
Unterstützer

Sprachen: Englisch (English ) Spanisch (Español )

Zeitzone: Europe/London (GMT+01:00)

Screenshot 2022-02-15 at 07.56.26.png

Hi there

According to the plugin documentation it seems that the number of likes are stored in a custom field with the key "Likes", see versteckter Link.

So you should be able to set your View to order by this custom field: see the screenshot.

Note, however, that because this isn't a Types custom field, the field will only be offered in the ordering dropdown if a scan of the fields of a sample post finds an entry for that field. (The sample post would be the first post the View would load based on the existing ordering.)

So you need to make sure that the posts being queried by the View actually have some data for Likes, then you will find you can order by that field in the View settings.

#2292585

{ticket status updated}

#2299115

My issue is resolved now. Thank you!