我想知道如何添加一个自定义字段来显示图像,而不是在Wordpress stats的stats\\u get\\u csv上显示标题。
<?php if ( function_exists(\'stats_get_csv\') && $top_posts = stats_get_csv(\'postviews\', \'days=2&limit=6\') ) : ?>
<ol>
<?php foreach ( $top_posts as $p ) : ?>
<li><a href="<?php echo $p[\'post_permalink\']; ?>"><?php echo $p[\'post_title\']; ?></a></li>
<?php endforeach; ?>
</ol>
<?php endif; ?>
Update
<?php if ( function_exists(\'stats_get_csv\') && $top_posts = stats_get_csv(\'postviews\', \'days=2&limit=6\') ) : ?>
<?php if ( get_post_meta($post->ID, \'Image\', true) ) : ?>
<ol>
<?php foreach ( $top_posts as $p ) : ?>
<li>
<img class="thumb" src="<?php echo get_post_meta($post->ID, \'Image\', true) ?>" alt="<?php the_title(); ?>" height=\'100\' width=\'100\' />
</li>
<?php endforeach; ?>
</ol>
<?php endif; ?>
<?php endif; ?>