Esempio n. 1
0
        </div>

</div><!-- cl-blog-naz -->
    <div style="overflow: hidden; width: 100%;">
        <div class="cl-blog-read"><a href="<?php 
    echo esc_url($PHT_permalink);
    ?>
"><i class="fa fa-angle-double-right"></i> <?php 
    _e('Read More', 'grandway');
    ?>
</a></div>
        <?php 
    if (!is_single()) {
        ?>
          <div class="cl-blog-like"><?php 
        echo PhoenixTeam_Likes::getPostLikeLink($post->ID);
        ?>
</div>
        <?php 
    }
    ?>
    </div>
    <?php 
}
?>

<?php 
if ($PHT_layout == 'medium') {
    ?>
</div>
<?php 
Esempio n. 2
0
                $pop_posts->the_post();
                echo "<li><a href='" . esc_url(get_permalink($post->ID)) . "'>" . esc_html(get_the_title()) . "</a></li>\n";
            }
            echo "</ul>\n";
            echo "</aside>\n";
        }
        wp_reset_postdata();
    }
    /**
     * Outputs a list of the 5 posts with the most user likes
     * Markup assumes sidebar/widget usage
     */
    public static function jm_most_popular()
    {
        global $post;
        echo "<aside>\n";
        echo "<h3>" . _e('Most Popular Posts', 'grandway') . "</h3>\n";
        echo "<ul>\n";
        $args = array('post_type' => array('post', 'enter-your-comma-separated-post-types-here'), 'meta_query' => array(array('key' => '_post_like_count', 'value' => '0', 'compare' => '>')), 'meta_key' => '_post_like_count', 'orderby' => 'meta_value_num', 'order' => 'DESC', 'posts_per_page' => 5);
        $pop_posts = new WP_Query($args);
        while ($pop_posts->have_posts()) {
            $pop_posts->the_post();
            echo "<li><a href='" . esc_url(get_permalink($post->ID)) . "'>" . esc_html(get_the_title()) . "</a></li>\n";
        }
        wp_reset_postdata();
        echo "</ul>\n";
        echo "</aside>\n";
    }
}
PhoenixTeam_Likes::construct();