-
<? php $popular = new WP_Query('orderby=comment_count&posts_per_page=5'); ?> -
<? php while ( $popular ->have_posts()) : $popular ->the_post(); ?> -
<? php $justanimage = get_post_meta( $post ->ID, 'image', true); -
if ( $justanimage ) { ?> -
<img src= "<?php echo get_post_meta($post->ID, " image ", true); ?>" alt= "<?php the_title(); ?> " /> -
<? php } else { ?> -
<img src= " https://zmingcx.com/wp-content/themes/HotNewspro3/images/logo.png " alt= "" /> -
<? php } ?> -
<h2><a href= "<?php the_permalink(); ?> " ><? php the_title(); ?></ a></h2> -
<? php endwhile ; ?>