这可能是一个基本问题,但我似乎找不到一个正确的解决方案。PHP高级自定义字段
在我已经设置了场群CD先进的自定义字段,在CD有三个字段,标题信息,作者和组显示出,如果类别= CD
因此,当我提出一个新帖子CD类别填写这三个字段。 CD类别中有10个帖子。
现在我遇到的问题是显示页面上的所有帖子。
这里是我试过
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php query_posts(array( 'posts_per_page' => -1, 'cat' => '6', 'CD' => (get_query_var('CD') ? get_query_var('CD') : 1),));
if (have_posts()) {
while (have_posts()) {
the_post();
get_post_meta();
} // end while
} // end if
?>
<?php endwhile; endif; ?>
这将返回一个错误Warning: Missing argument 1 for get_post_meta(), called in /Volumes/shared/Digital/_Websites/londonconchord/wp-content/themes/conchord/t-disc.php on line 25 and defined in /Volumes/shared/Digital/_Websites/londonconchord/wp-includes/post.php on line 1792
我尝试了不同的尝试
<p><?php query_posts('cat=6');
the_field('title');
the_field('info');
the_field('author'); ?></p>
我在这里更多的运气,因为我是打印一些信息的代码,但只有第一个职位的类别,并不断重复,我想要所有10个职位,不重复。
我想我只是接近寻找那些最终指针
感谢
'的ACF?><?php'为什么? – Havenard