<article class="block block--inset block--list"> <a href="<?php the_permalink(); ?> "> <div class="post-status u-clearfix"> <?php echo get_avatar(get_the_author_meta('user_email'), 64); the_content(''); ?> </div> </a> <div class="status-footer"> <span><?php if (function_exists('wpl_get_like_count')) { echo wpl_get_like_count(get_the_ID()); } ?> likes . <?php echo get_comments_number(); ?> replies.</span> </div> </article>
function lion_post_list($type = 'latest', $num = 5) { if ($type == 'popular') { $the_query = new WP_Query(array('posts_per_page' => $num, 'orderby' => 'meta_value_num', 'meta_key' => '_post_like')); } elseif ($type == 'modified') { $the_query = new WP_Query(array('posts_per_page' => $num, 'orderby' => 'modified')); } else { $the_query = new WP_Query(array('posts_per_page' => $num, 'orderby' => 'latest')); } $post_list = ''; while ($the_query->have_posts()) { $the_query->the_post(); $post_list .= '<li class="list-item u-clearfix"><a href="' . get_permalink() . '" title="' . get_the_title() . '"><div class="list-item-image'; if (!lion_is_has_image()) { $post_list .= ' no-image'; } $post_list .= ' u-floatLeft" style="background-image:url(' . get_post_thumbnail() . ')"></div><div class="list-item-title">' . get_the_title() . '</div><div class="list-item-meta">' . get_the_date('Y-m-d'); if (function_exists('wpl_get_like_count')) { $post_list .= '<span class="middotDivider"></span>' . wpl_get_like_count() . ' likes'; } $post_list .= '</div></a></li>'; } wp_reset_postdata(); return $post_list; }
function puma_post_section() { global $post; $post_section = '<article class="block block--inset block--list"><h2 class="block-title post-featured"><a href="' . get_permalink() . '">' . get_the_title() . '</a></h2> <div class="block-postMetaWrap u-textAlignCenter"> <time>' . get_the_date('Y/m/d') . '</time> </div> <div class="block-snippet block-snippet--subtitle grap" itemprop="about">'; if (has_post_thumbnail()) { $post_section .= '<p class="with-img">' . get_the_post_thumbnail() . '</p><p>' . mb_strimwidth(strip_shortcodes(strip_tags(apply_filters('the_content', $post->post_content))), 0, 220, "...") . '</p>'; } else { $post_section .= apply_filters('the_content', get_the_content('')); } $post_section .= '</div> <div class="block-footer"> By ' . get_the_author() . ' . In ' . get_the_category_list(',') . '. <div class="block-footer-inner">'; if (function_exists('wpl_get_like_count')) { $post_section .= wpl_get_like_count(get_the_ID()) . ' likes . '; } $post_section .= get_comments_number() . ' replies.</div></div></article>'; return $post_section; }
} else { ?> <?php the_content('Read More.'); ?> <?php } ?> </div> <div class="block-footer"> By <?php the_author(); ?> . In <?php the_category(','); ?> . <div class="block-footer-inner"> <?php if (function_exists('wpl_get_like_count')) { echo wpl_get_like_count(get_the_ID()) . ' ' . __('likes', 'puma') . ' . '; } echo get_comments_number(); ?> <?php echo __('replies', 'puma'); ?> . </div> </div> </article>