【发布时间】:2010-12-09 13:00:37
【问题描述】:
我正在尝试自定义一个 wordpress 插件,其中使用了自定义标签“get_post_meta()”。 代码如下:
<?php query_posts('showposts=5'); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<h2>" title="<?php the_title(); ?>">
<?php the_title(); ?></h2>
<?php the_excerpt(); ?>
<?php $gallery = get_post_meta($post->ID, 'Thumbnail', $single = true); ?>
<img src="<?php echo $gallery; ?>">`
我尝试将参数设为 false 并检索数组值,但它只返回一个值。 但它没有发生。还在 the_post() 之后尝试使用 foreach 循环。谁能建议我一次发几个帖子。实际上我想要不同的图片网址,这意味着几个 $gallery。
提前致谢。
【问题讨论】:
标签: wordpress custom-tag