• Resolved plantman

    (@plantman)


    Hi, is it possible to remove the drop animation when you click the reply button and when you click to see more replies button? thanks

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter plantman

    (@plantman)

    Also is it possible to replace the like button with a heart icon?

    Plugin Support gVectors Support

    (@gvectorssupport)

    Hi @plantman,

    is it possible to remove the drop animation when you click the reply button and when you click to see more replies button?

    We’ll add a new option, that will allow controlling animation time in next version release. Please wait for the next update. It’ll come soon.

    Also is it possible to replace the like button with a heart icon?

    I’m really sorry, but wpDiscuz doesn’t have any option for this purpose. You need to do some customization using the following hooks:

    apply_filters('wpdiscuz_vote_up_icon', $voteFaUpImg, $comment, $currentUser);
    apply_filters('wpdiscuz_vote_down_icon', $voteFaDownImg, $comment, $currentUser);
    Thread Starter plantman

    (@plantman)

    Hi, thanks for the reply. How would I use those hooks to change the icon? thanks

    Plugin Support gVectors Support

    (@gvectorssupport)

    Hi @plantman,

    put the following code in your current active theme functions.php file:

    add_filter('wpdiscuz_vote_up_icon', 'custom_vote_up_icon', 10, 3);
    
    if (!function_exists('custom_vote_up_icon')) {
    
       function custom_vote_up_icon($voteFaUpImg, $comment, $currentUser) {
           if (preg_match('#<i[\r\n\t\s]*class=[\'\"]([^\'\"]+)[\'\"]>[^<]*</i>#isu', $voteFaUpImg, $matches)) {
               $voteFaUpImg = str_replace($matches[1], 'fas fa-heart wc-vote-img-up', $voteFaUpImg);
           }
           return $voteFaUpImg;
       }
    
    }
    
    add_filter('wpdiscuz_vote_down_icon', 'custom_vote_down_icon', 10, 3);
    
    if (!function_exists('custom_vote_down_icon')) {
    
       function custom_vote_down_icon($voteFaDownImg, $comment, $currentUser) {
           if (preg_match('#<i[\r\n\t\s]*class=[\'\"]([^\'\"]+)[\'\"]>[^<]*</i>#isu', $voteFaDownImg, $matches)) {
               $voteFaDownImg = str_replace($matches[1], 'far fa-heart fa-rotate-180 wc-vote-img-down', $voteFaDownImg);
           }
           return $voteFaDownImg;
       }
    
    }

    Please note: wpDiscuz uses only Font Awesome icons.

    If you’d like to change heart icon in the provided code you need to change fas fa-heart, far fa-heart fa-rotate-180 font awesome icons class names.

    In any case please don’t remove wc-vote-img-up, wc-vote-img-dow classes.

    Thread Starter plantman

    (@plantman)

    Hi,
    That code works great when I only have the original plugin installed, but stops working when I install the Advanced Liking plugin. Whats the problem?
    Thanks

    Thread Starter plantman

    (@plantman)

    ?

    Plugin Support gVectors Support

    (@gvectorssupport)

    Hi @plantman,

    Please delete the code in the previous post and put the following one in your active theme functions.php file.

    add_filter('wpdiscuz_vote_up_icon', 'custom_vote_up_icon', 20, 3);
    
    if (!function_exists('custom_vote_up_icon')) {
    
       function custom_vote_up_icon($voteFaUpImg, $comment, $currentUser) {
           if (preg_match('#<i[\r\n\t\s]*class=[\'\"]([^\'\"]+)[\'\"]>[^<]*</i>#isu', $voteFaUpImg, $matches)) {
               $voteFaUpImg = str_replace($matches[1], 'fas fa-heart wc-vote-img-up', $voteFaUpImg);
           }
           return $voteFaUpImg;
       }
    
    }
    
    add_filter('wpdiscuz_vote_down_icon', 'custom_vote_down_icon', 20, 3);
    
    if (!function_exists('custom_vote_down_icon')) {
    
       function custom_vote_down_icon($voteFaDownImg, $comment, $currentUser) {
           if (preg_match('#<i[\r\n\t\s]*class=[\'\"]([^\'\"]+)[\'\"]>[^<]*</i>#isu', $voteFaDownImg, $matches)) {
               $voteFaDownImg = str_replace($matches[1], 'far fa-heart fa-rotate-180 wc-vote-img-down', $voteFaDownImg);
           }
           return $voteFaDownImg;
       }
    
    }
    Thread Starter plantman

    (@plantman)

    Hi,
    This code works better but removes some of the functionality of the Advanced Liking plugin such as changing color when you hover and staying the liked color when you reload the page. How can I keep this functionality?

    Thanks

    Thread Starter plantman

    (@plantman)

    ?

    Plugin Support gVectors Support

    (@gvectorssupport)

    Hi plantman,

    This code should work fine. Please delete the old code and put the following one.

    add_filter('wpdiscuz_vote_up_icon', 'custom_vote_up_icon', 20, 3);
    
    if (!function_exists('custom_vote_up_icon')) {
    
       function custom_vote_up_icon($voteFaUpImg, $comment, $currentUser) {
           if (preg_match('#<i[\r\n\t\s]*class=[\'\"]([^\'\"]+)[\'\"]>[^<]*</i>#isu', $voteFaUpImg, $matches)) {
               $voteFaUpImg = str_replace($matches[1], 'fas fa-heart wc-vote-img-up wv-up-default-color', $voteFaUpImg);
           }
           return $voteFaUpImg;
       }
    
    }
     
    add_filter('wpdiscuz_vote_down_icon', 'custom_vote_down_icon', 20, 3);
    
    if (!function_exists('custom_vote_down_icon')) {
    
       function custom_vote_down_icon($voteFaDownImg, $comment, $currentUser) {
           if (preg_match('#<i[\r\n\t\s]*class=[\'\"]([^\'\"]+)[\'\"]>[^<]*</i>#isu', $voteFaDownImg, $matches)) {
               $voteFaDownImg = str_replace($matches[1], 'far fa-heart fa-rotate-180 wc-vote-img-down wv-down-default-color', $voteFaDownImg);
           }
           return $voteFaDownImg;
       }
    
    }
Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Remove drop anamation’ is closed to new replies.