Home Forums WTI Like Post PRO Display authors most liked post on author.php

This topic contains 4 replies, has 2 voices, and was last updated by  Webtechideas 1 year, 4 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #430

    SteebZA
    Participant

    Hi there,

    The pro features list mentions the ability to display the most liked post from an author on that authors page (author.php) but I can’t seem to find how to implement that, I’ve tried copying code from the most-liked-posts.php template but it doesn’t seem to work, no sure how I would go about doing that? any assistance here would be much appreciated.

    Thanks,
    Steve

    #431

    Webtechideas
    Keymaster

    You need to use the code from content-likes.php file. It will show the posts liked by the author. If you want to show the most liked posts authored by the author, then you need to change the query by replacing WHERE L.user_id = {$author->ID} with WHERE P.post_author = {$author->ID}. Do let us know if this helped you or not.

    #432

    SteebZA
    Participant

    Perfect, thanks!

    Steve

    #433

    SteebZA
    Participant

    One more quick question; how would I display the content of the top 2 posts out of all posts on a template page? Thanks

    #434

    Webtechideas
    Keymaster

    You can use the above query without the user/author condition with a LIMIT restriction. You can also refer to our blog where this has been explained using meta data. You can remove the category check and add LIMIT.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.