function laborator_portfolio_like_column_content($column, $post_id)
{
    global $post;
    switch ($column) {
        case "likes":
            $likes = get_post_likes();
            echo '<span class="likes-num">' . number_format_i18n($likes['count'], 0) . '</span>';
            echo ' <a href="#" data-id="' . $post_id . '" class="portfolio-likes-reset" title="Reset likes for this item"> - <span>Reset</span></a>';
            break;
    }
}
		<?php 
    }
    ?>

	</div>
	<?php 
}
# Rounded Buttons
if ($portfolio_like_share_layout == 'rounded') {
    ?>
	<div class="social-buttons social">

		<div class="social-links">
			<?php 
    if ($portfolio_likes) {
        $likes = get_post_likes();
        ?>
			<a href="#" class="social-share-icon like-btn<?php 
        echo $likes['liked'] ? ' is-liked' : '';
        ?>
" data-id="<?php 
        the_ID();
        ?>
">
				<i class="icon fa fa-heart<?php 
        echo $likes['liked'] ? '' : '-o';
        ?>
"></i>
				<span class="like-count"><?php 
        echo esc_html($likes['count']);
        ?>
Esempio n. 3
0
function find_post($id)
{
    $id = mysql_real_escape_string($id);
    $id = str_replace('-', ' ', $id);
    $query = mysql_query("SELECT * FROM blog_posts WHERE title='{$id}'");
    $postArray = array();
    while ($row = mysql_fetch_array($query)) {
        $comments = get_comments($row['id']);
        $author = get_author($row['author_id']);
        $likes = get_post_likes($row['id']);
        $postArray[] = array('id' => $row["id"], 'title' => $row['title'], 'post' => $row['posts'], 'postfull' => $row['postfull'], 'author' => $author, 'date_posted' => $row['date_posted'], 'comments' => $comments, 'likes' => $likes);
    }
    foreach ($postArray as $v) {
        $date = $v['date_posted'];
        $post->date = $date;
        $post->id = $v['id'];
        $post->title = $v['title'];
        $post->body = $v['post'];
        $post->comments = $v['comments']['total'];
        $post->author = $v['author'][0]['name'];
        $post->author_id = $v['author'][0]['id'];
        $post->likes = $v['likes'][0]['likes'];
        return $post;
    }
    //return $false;
    //  return false;
}