0
我有一個WordPress網站的父頁面下面的代碼。此頁面從子頁面抽取內容以便以摘要格式顯示。我所缺少的是如何從子頁面中拉取精選圖片網址的代碼。標題和內容被很好地拉動。有任何想法嗎?WordPress的 - 得到一個孩子頁精選圖片來源URL
<?php
$mypages = get_pages(array('child_of' => $post->ID, 'sort_column' => 'post_date', 'sort_order' => 'desc'));
foreach($mypages as $page) {
$content = $page->post_content;
if (! $content) // Check for empty page
continue;
$content = apply_filters('the_content', $content);
?>
<h2><a href="<?php echo get_page_link($page->ID); ?>"><?php echo $page->post_title; ?></a></h2>
<div class="entry"><?php echo $content; ?></div>
<?php
}
?>