我在wordpress主题上使用高级自定义字段创建了自定义帖子。它是一个配置文件页面,显示用户基本信息以及标题为每周活动和存档部分的图库部分。我想存档“每周活动”下显示的图库,以便在“存档”下的页面上列出存档。我不太确定如何解决这个问题。这是我的前端模板代码:
<?php get_header(); ?>
<?php the_post(); ?>
<div class = "hcontainer">
<div class = "leftcol">
<?php
$image = get_field('profile_picture');
if( !empty($image) ): ?>
<img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" />
<?php endif; ?>
<p class ="lfeilds">Name:<?php the_field('name'); ?></p>
<p class ="lfeilds">Age:<?php the_field('age'); ?></p>
<p class ="lfeilds">Gender:<?php the_field('gender'); ?></p>
<p class ="larchive">Gallery Archive</p>
***<?php the_field('archive'); ?>***
</div>
<div class ="rightcol">
<p class ="rtitle">Weekly Activities</p>
<div class ="rgallery">
<?php
$image_ids = get_field('gallery', false, false);
$shortcode = '[gallery ids="' . implode(',', $image_ids) . '"]';
echo do_shortcode( $shortcode );
?>
</div>
</div>
</div>