0
我找不到解決方案,我對WordPress模板很陌生。使用父模板中的模板樣式加載兒童內容
我想從我的活動頁面加載所有直接孩子,並將它們與模板一起加載,該模板還使用一個在acf中添加的圖像。這個想法是爲加載的內容提供超過1個靜態設計。
這是我正在使用的代碼,但the_content()只加載內容字段本身,而不是模板或acf圖像。
我試過get_post,但它不起作用。
我真的很感激,如果你能幫助我。 :)
最良好的祝願,
邁克
<?php
$args = array(
'post_type' => 'page',
'posts_per_page' => -1,
'post_parent' => $post->ID,
'order' => 'ASC',
'orderby' => 'menu_order'
);
$parent = new WP_Query($args);
if ($parent->have_posts()) :
while ($parent->have_posts()) : $parent->the_post();
\t the_content();
endwhile;
endif;
wp_reset_query();
?>