【发布时间】:2023-03-13 17:45:01
【问题描述】:
我正在使用高级自定义字段。我想链接类型自定义字段的值(例如惊悚片,悬念等),以便当用户单击其中一个值时,他们将获得过滤后的帖子列表。例如。当他们点击 Thriller 时,他们将获得 Thriller 类别中的所有帖子。
到目前为止,我的 ACF 代码如下:
<!-- Entry Content Start -->
<article <?php post_class('entry clearfix fitvids'); ?>>
<div class="inner-post">
<div class="cover">
<div class="post-image">
<?php
if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
the_post_thumbnail();
}
?>
</div>
<div class="custom-fields">
<?php the_meta(); ?>
<div class="ad">
<img src="http://lorempixel.com/160/600" alt="">
</div>
</div>
</div>
<div class="the-content">
<?php the_content(); // This is your main post content output ?>
</div>
</div><!-- /inner-post -->
</article><!-- /entry -->
有解决办法吗?
【问题讨论】:
标签: php wordpress custom-fields