This topic has 3 replies, 2 voices, and was last updated 8 years by Radu.

  • Author
  • #101528
     wilhalphoto
    Participant

    Hi,

    1. How can I reset # of likes? (kleo-love)
    2. I’d like to only allow registered user to vote/like, how can i do that?

    thanks a bunch!
    -will

    #101758
     Radu
    Moderator

    Hi,

    You can hide the like/love functionality for logged out users by using this function

    COPY CODE
    
    function AllowKleoLikesToLoggedInUsers () {
        global $kleo_item_likes;
        if(!is_user_logged_in()) {
            remove_action('publish_post', array($kleo_item_likes, 'setup_likes'));
            remove_action('kleo_post_footer', array($kleo_item_likes, 'show_likes'));
            remove_action('kleo_show_love', array($kleo_item_likes, 'show_likes'));
            remove_action('wp_ajax_item-likes', array($kleo_item_likes, 'ajax_callback'));
            remove_action('wp_ajax_nopriv_item-likes', array($kleo_item_likes, 'ajax_callback'));
    
        }
    
    }
    add_action('after_setup_theme', 'AllowKleoLikesToLoggedInUsers', 99);
    
    
    

    The function needs to be added to wp-content/themes/kleo-child/functions.php

    NOTE : Child theme needs to be installed and activated

    You can reset the post likes via phpmyadmin with this query

    COPY CODE
    wp_postmeta

    Cheers

    Radu

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #102692
     wilhalphoto
    Participant

    Thanks for the solution and the quick reply!

    #102719
     Radu
    Moderator

    Great,

    Have a nice week

    Cheers

    Radu

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

Log in with your credentials

Forgot your details?