Home Forums WTI Like Post PRO Override output of GetWtiLikePost

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #153
    firefly
    Participant

    Is there a supported way to override the output of GetWtiLikePost? My theme has some particular markup requirements and I need to be able to separate the like/unlike buttons from the values (among other things). Is there a built-in way to tweak the output or do I need to write my own method?

    #156
    Webtechideas
    Keymaster

    There is a setting to disable the automatic loading of the like/unlike buttons. Then you can define your own function to have the desired output as per your requirement.

    #157
    firefly
    Participant

    Gotcha ok.

    On the off chance this helps someone else, here are some utility methods for dealing with buttons/counts (based on ripping apart GetWtiLikePost). Just stick them in functions.php

    http://pastebin.com/JzFeKkUb

    They all take an optional post_id as an argument so can be used outside the loop. Additionally they check for the existence of plugin methods (using ff_is_like_enabled), so disabling the ‘like’ plugin doesn’t break the theme.

    The method names follow general wordpress convention:
    ff_XX = echo XX
    ff_get_XX = return XX as string

    Wherever you place the tally number has to have the class ‘lc lc-{{post_id}}’ – e.g.
    $id = $post->ID;
    $num_likes = ff_get_like_count($id);
    printf(‘<span class=”tally-value lc lc-%d”>%d</span>’, $id, $num_likes);

    That way you don’t need to mess with the default plugin javascript and all the ajax stuff works.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘WTI Like Post PRO’ is closed to new topics and replies.