我正在使用ACF,因此用戶可以將圖像上載到預定義的位置並相應地分配頁面規則。在WP後端上,一切似乎都很順利,將三張圖片上傳到了字段中。但是,在字體結尾處,除了空白框外,沒有任何東西出現在所有圖像應該在的位置。望着那WP的輸出源,只有空白代碼:高級自定義字段Wordpress插件 - 圖像不顯示
<img src="" class="middle" alt="image1"/>
這是我使用的循環:
<?php query_posts("posts_per_page=1&post_type=page&page_id=168"); if (have_posts()) :
while (have_posts()) :
the_post(); ?>
<!--If you want to refer to the child of parent page, use "post_parent=" -->
<li>
<h3><?php the_title(); ?></h3>
<?php the_excerpt(); ?>
<img src="<?php the_field('image_1'); ?>" class="middle" alt="image1"/>
<a href="<?php the_permalink(); ?>" class="button">View More</a>
</li>
<?php endwhile; ?>
<!-- post navigation -->
<?php else: ?>
<!-- no posts found -->
<?php endif; ?>
<?php wp_reset_query(); ?>
重要的是要注意,我不拉的圖像是非常重要的另一頁。我只想讓圖片與我正在處理的模板&相關。
它顯然是the_field()的問題,什麼是the_field(),你是怎麼寫這個函數的? – bingjie2680
你以前用過這個插件嗎? the_field是標準的。 – tobeeornot