Esempio n. 1
0
/**
 * (5) Front end button
 */
function getPostLikeLink($post_id)
{
    $like_count = get_post_meta($post_id, "_post_like_count", true);
    // get post likes
    $count = empty($like_count) || $like_count == "0" ? '' : $like_count;
    if (AlreadyLiked($post_id)) {
        $class = __(' liked', 'codeless');
        $heart = '<i class="linecon-icon-heart"></i>';
    } else {
        $class = '';
        $heart = '<i class="linecon-icon-heart"></i>';
    }
    $output = '<a href="#" class="jm-post-like' . esc_attr($class) . '" data-post_id="' . esc_attr($post_id) . '" title="">' . $heart . '&nbsp;' . $count . '</a><span class="jm-load"></span>';
    return $output;
}
Esempio n. 2
0
/**
 * (4) Front end button
 */
function getPostLikeLink($post_id)
{
    $like_count = get_post_meta($post_id, "_post_like_count", true);
    // get post likes
    $count = empty($like_count) || $like_count == "0" ? 'Like' : esc_attr($like_count);
    if (AlreadyLiked($post_id)) {
        $class = esc_attr(' liked');
        $title = esc_attr('Unlike');
        $heart = '<i id="icon-like" class="icon-like"></i>';
    } else {
        $class = esc_attr('');
        $title = esc_attr('Like');
        $heart = '<i id="icon-unlike" class="icon-unlike"></i>';
    }
    $output = '<a href="#" class="jm-post-like' . $class . '" data-post_id="' . $post_id . '" title="' . $title . '">' . $heart . '&nbsp;' . $count . '</a>';
    return $output;
}
Esempio n. 3
0
function getPostLikeLink($post_id)
{
    $like_count = get_post_meta($post_id, "_post_like_count", true);
    // get post likes
    if (!$like_count || $like_count && $like_count == "0") {
        // no votes, set up empty variable
        $likes = '0';
    } elseif ($like_count && $like_count != "0") {
        // there are votes!
        $likes = esc_attr($like_count);
    }
    $output = '<span class="thing-post-like">';
    $output .= '<a href="#" data-post_id="' . $post_id . '">';
    if (AlreadyLiked($post_id)) {
        // already liked, set up unlike addon
        $output .= '<span class="like prevliked"><i class="fa fa-heart"></i></span>';
        $output .= ' <span class="count alreadyliked">' . $likes . '</span></a></span>';
    } else {
        // normal like button
        $output .= '<span class="like"><i class="fa fa-heart-o"></i></span>';
        $output .= ' <span class="count">' . $likes . '</span></a></span>';
    }
    if (rehub_option('exclude_post_like') != '1') {
        return $output;
    } else {
        return false;
    }
}
Esempio n. 4
0
/**
 * (4) Front end button
 */
function getPostLikeLink($post_id)
{
    $like_count = get_post_meta($post_id, "_post_like_count", true);
    // get post likes
    $count = empty($like_count) || $like_count == "0" ? '0' : esc_attr($like_count);
    if (AlreadyLiked($post_id)) {
        $class = esc_attr('liked');
    } else {
        $class = esc_attr('');
    }
    $output = '<a href="#" class="jm-post-like ' . $class . '" data-post_id="' . $post_id . '"><div class="like-button"><span class="icon-ico-thumbup"></span> Gefällt mir</div></a><div id="like-count-' . $post_id . '" class="like-count">' . $count . '</div>';
    return $output;
}
Esempio n. 5
0
function royal_get_likes($post_id, $icon)
{
    $like_count = get_post_meta($post_id, "_post_like_count", true);
    if (AlreadyLiked($post_id)) {
        $title = esc_html__('Unlike', 'hyperx');
        $heart = '<i class="fa fa-' . $icon . '"></i>';
    } else {
        $title = esc_html__('Like', 'hyperx');
        $heart = '<i class="fa fa-' . $icon . '"></i>';
    }
    $output = '<a href="#" class="royal-post-like" data-post_id="' . esc_attr($post_id) . '" title="' . esc_attr($title) . '">';
    $output .= $heart . '&nbsp;<span class="rf-likes-count">' . $like_count . '</span></a>';
    return $output;
}
/**
 * (5) Front end button
 */
function getPostLikeLink($post_id)
{
    $theme_object = wp_get_theme();
    $themename = esc_attr($theme_object->Name);
    // the theme name
    $like_count = get_post_meta($post_id, "_post_like_count", true);
    // get post likes
    if (!$like_count || $like_count && $like_count == "0") {
        // no votes, set up empty variable
        $likes = 'Like';
    } elseif ($like_count && $like_count != "0") {
        // there are votes!
        $likes = esc_attr($like_count);
    }
    $output = '<span class="post-like">';
    $output .= '<a href="#" data-post_id="' . $post_id . '">';
    if (AlreadyLiked($post_id)) {
        // already liked, set up unlike addon
        $output .= '<span class="unliker"><i class="dashicons dashicons-no-alt"></i></span><span class="like prevliked"><i class="dashicons dashicons-heart"></i></span>';
        $output .= ' <span class="count alreadyliked">' . $likes . '</span></a></span>&nbsp; ';
    } else {
        // normal like button
        $output .= '<span class="unliker"></span><span class="like"><i class="dashicons dashicons-heart"></i></span>';
        $output .= ' <span class="count">' . $likes . '</span></a></span>&nbsp; ';
    }
    return $output;
}