Viewing 7 replies - 1 through 7 (of 7 total)
  • Hello,
    Use the hook You can display all the necessary:

    asgarosforum_after_post_message

    add_action('asgarosforum_after_post_message', 'my_function_functionname', 10, 3);
    function my_function_functionname($author_id) {
    //your code
    
    }

    Example:
    https://image.prntscr.com/image/25e18fbd0dfe4ede97f9753185a6d9cd.png

    Plugin Author Asgaros

    (@asgaros)

    Yes,

    Yworld made a really good example on how to implement this because I think at the moment this is not a feature I want to implement in the core-plugin because I want to keep it as clean and simple as possible. Btw: Nice work on your forum @ Yworld! ??

    I made some little change at the hook to the dev-version so it is easier to implement this feature (added the post-id):
    https://github.com/Asgaros/asgaros-forum/commit/6f0b21486f343d345da5ab03a0e53fe3d776f13a

    Thank you very much Asgaros!

    Thread Starter xagorvangard

    (@xagorvangard)

    Thanks for the respond. Unfortunately, I’m not that familiar with hooks and I’m lost on what I need to do. I did find a plugin that I maybe able to use. It’s called WP ULike. It has this function.

    Function:

    <?php if(function_exists(‘wp_ulike’)) wp_ulike(‘get’); ?>

    Can I get assistance on how to implement this?

    Sorry, just learning how WordPress works.

    TIA

    Plugin Author Asgaros

    (@asgaros)

    Hey,

    you can try to add this code to your themes functions.php file:

    add_action('asgarosforum_after_post_message', 'my_function_functionname', 10, 3);
    
    function my_function_functionname($author_id) {
        if(function_exists('wp_ulike')) wp_ulike('get');
    }

    But the problem is that this is working on a per-page basis and not per post. Maybe there is a way to add the post-id to the sites-parameter of the wp_ulike-call.

    Thread Starter xagorvangard

    (@xagorvangard)

    Asgaros,

    Thanks for the lesson on where to put the code. You are right it worked that way but per page basis. Now I just need to find out how to do it per post basis.

    Thanks again for the help!

    Thread Starter xagorvangard

    (@xagorvangard)

    YWorld,

    Can I ask which Like button plugin you are using? WP Ulike has not been updated in 8 months and the author is not replying to the questions I posted.

    Thank you in advance.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Like/Dislike button voting Feature’ is closed to new replies.