Created
February 13, 2015 15:35
-
-
Save setuix/0d5c2e51a1f9e1c974a9 to your computer and use it in GitHub Desktop.
most_commented_without_plugin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php $popular = newWP_Query('orderby=comment_count&posts_per_page=5'); ?> | |
<?php while ($popular->have_posts()) : $popular->the_post(); ?> | |
<?php $justanimage = get_post_meta($post->ID,'thumbnail', true); | |
if ($justanimage) { ?> | |
<img src="<?php echo get_post_meta($post->ID, "Image", true); ?>" alt="<?php the_title(); ?>" /> | |
<?php } else { ?> | |
<img src="<a href="/web/20120228235855/http://an-alternative-image.jpg"" rel="nofollow">http://an-alternative-image.jpg"</a>; alt="" /> | |
<?php } ?> | |
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> | |
<?php endwhile; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment