[WordPress][memo]よく読まれる記事

<div id="most-popular" class="widget">
	<h2 class="widgettitle">よく読まれる記事</h2>
	
	<ul>
		
		
	<?php $posts = wmp_get_popular( array( 'limit' => 5, 'post_type' => 'post', 'range' => 'monthly' ) );
	global $post;
	if ( count( $posts ) > 0 ): foreach ( $posts as $post ): setup_postdata( $post ); ?>
	
	
	<li class="row">
	
	
	<div class="large-4 columns">
		<?php if (has_post_thumbnail()) : ?>
		    <?php the_post_thumbnail('medium'); ?>
		<?php else : ?>
		    <img src="<?php bloginfo('template_url'); ?>/assets/images/no-image.png" alt="no-image" />
		<?php endif ; ?>					    
	</div>

	<div class="large-8 columns">
		<p class="post-title"><a href="<?php the_permaLink(); ?>"><?php the_title(); ?></a></p>
		<?php get_template_part( 'parts/content', 'byline' ); ?>
		<!--<?php the_excerpt(); ?>-->
	</div>	    
			    
		
	
	</li>
	
	
	<?php endforeach; endif; wp_reset_postdata(); ?>
	
	</ul>
</div>
共有
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
Posts published: 45
Copyrights © idew. All Rights Reserved.