echo $single_layout;
        ?>
-layout mk-grid vc_row-fluid <?php 
        echo $padding;
        ?>
">
			<div class="theme-content <?php 
        echo $padding;
        ?>
 no-margin-top">

						<?php 
        if ($mk_options['single_portfolio_cats'] == 'true') {
            ?>
						<span class="portfolio-single-cat"><?php 
            echo implode(', ', mk_get_portfolio_tax(get_the_id(), true));
            ?>
</span>
						<?php 
        }
        ?>


						<?php 
        if ($mk_options['single_portfolio_social'] == 'true' && get_post_meta($post->ID, '_portfolio_social', true) != 'false') {
            ?>

						<?php 
            /*   Social Share */
            ?>
						<div class="single-social-section portfolio-social-share">
Example #2
0
/**
 * Create the function to output the contents of our Dashboard Widget.
 */
function mk_posts_like_stats_func()
{
    $args = array('post_type' => 'post', 'posts_per_page' => 5, 'order' => 'DESC', 'orderby' => 'meta_value_num', 'meta_key' => '_mk_post_love');
    $query = new WP_Query($args);
    echo '<p>' . __('Popular Blog & Portfolio posts based on the number of post likes.', 'mk_framework') . '</p>';
    echo '<span class="mk-like-post-posttype-title">' . __('Popular Blog Posts', 'mk_framework') . '</span>';
    echo '<ol class="mk_posts_like_stats_ol">';
    // The Loop
    while ($query->have_posts()) {
        $query->the_post();
        $love_count = get_post_meta(get_the_id(), '_mk_post_love', true);
        echo '<li>';
        echo '<a target="_blank" href="' . get_permalink() . '" class="mk-like-post-title">' . get_the_title() . '</a>';
        echo '<span class="mk-like-post-count"><i class="dashicons dashicons-heart"></i>' . $love_count . '</span>';
        echo '<span class="mk-like-post-category">' . get_the_category_list(', ') . '</span>';
        echo '</li>';
    }
    echo '</ol>';
    wp_reset_postdata();
    $args = array('post_type' => 'portfolio', 'posts_per_page' => 5, 'order' => 'DESC', 'orderby' => 'meta_value_num', 'meta_key' => '_mk_post_love');
    $query = new WP_Query($args);
    echo '<span class="mk-like-post-posttype-title">' . __('Popular Portfolio Posts', 'mk_framework') . '</span>';
    echo '<ol class="mk_posts_like_stats_ol">';
    // The Loop
    while ($query->have_posts()) {
        $query->the_post();
        $love_count = get_post_meta(get_the_id(), '_mk_post_love', true);
        echo '<li>';
        echo '<a target="_blank" href="' . get_permalink() . '" class="mk-like-post-title">' . get_the_title() . '</a>';
        echo '<span class="mk-like-post-count"><i class="dashicons dashicons-heart"></i>' . $love_count . '</span>';
        echo '<span class="mk-like-post-category">' . implode(', ', mk_get_portfolio_tax(get_the_id(), false)) . '</span>';
        echo '</li>';
    }
    echo '</ol>';
    wp_reset_postdata();
}