Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: Change Like this and Dislike this text for some categories #426

    D
    Participant

    Figured it out, thanks for the push and the help Web Techies. I’m posting the solution for anyone that might want this functionality: in wti_like_post.php
    locate:

    $wti_user_likes .= ($users_count > 1 || ($users_count == 1 && $flag == true)) ? __('like this', 'wti-like-post') : __('likes this', 'wti-like-post');
    

    copy this line of code giving you two lines of the same block of code, one to customize for your own text targeting specified categories and the other to leave the same for remaining categories. When you’re finished your code block should look like this, with targeting categories:

    
    $my_cat_ids = array(PLACE CATEGORY NUMBERS HERE);
    $category_ids = wp_get_post_categories( $post_id );
    $match_array = array_intersect( $my_cat_ids, $category_ids );
    if ( !empty( $match_array ) ) {
    
    $wti_user_likes .= ($users_count > 1 || ($users_count == 1 && $flag == true)) ? __('MY CUSTOM TEXT', 'wti-like-post') : __('MY CUSTOM TEXT', 'wti-like-post');
    
    }else{
    
    $wti_user_likes .= ($users_count > 1 || ($users_count == 1 && $flag == true)) ? __('like this', 'wti-like-post') : __('likes this', 'wti-like-post');
    
    } ADDED CLOSING BRACKET
     }
       }
    • This reply was modified 3 years, 6 months ago by  D.
    in reply to: Customize The User Likes Name #261

    D
    Participant

    Thanks a lot. It worked like a charm, appreciate the clear response and your help.

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