我创建了一个自定义字段与高级自定义字段插件称为'colaboradores'字段徽标(图像),direccion(字符串)和mapa(图像);WordPress自定义字段外部HTML标签
在archive-colaboradores.php,我称之为WP_Quer。总之,代码为:
<?php
$args = array(
'post_type' => 'colaboradores',
'pagination' => false
); ?>
<?php $the_query = new WP_Query($args); ?>
<?php while (have_posts()) : the_post(); ?>
<?php get_template_part('content', 'colaboradores'); ?>
<?php endwhile; // end of the loop. ?>
所以在内容colaboradores.php我告诉我的自定义字段与the_field():
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<h1 class="entry-title"><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
<?php $image = get_field('logo'); ?>
<?php echo '<img src="' . $image['url'] . '" >'; ?>
<?php echo '<p>' . the_field('direccion') . '</p>'; ?>
<?php $image = get_field('mapa'); ?>
<?php echo '<img src="' . $image['url'] . '" >'; ?>
</article><!-- #post-## -->
一切都很好,除了direccion,这始终是外
标签与谷歌浏览器检查:
我已经删除了之前的所有代码。 the_field('direccion')。 '
'; ?>但问题仍然存在。你知道它为什么发作吗?谢谢。
感谢您的回答!我发现问题:* the_field()*包括回声:[ACF - the_field](http://www.advancedcustomfields.com/resources/the_field/)[/ link],最终的代码是:'
' – Joss