别介意我的问题。。。这是你的答案
将此函数放在函数上。php
// Get Featured Image Path
function get_featured_image_link($size){
global $post;
$get_featured_image_link = get_the_post_thumbnail($post->ID, $size);
preg_match("/(?<=src=[\'|\\"])[^\'|\\"]*?(?=[\'|\\"])/i", $get_featured_image_link, $thePath);
return $get_featured_image_link_final = $thePath[0];
}
那么这就是获取图像的过程。。。
<?php
$the_query = new WP_Query(
array(
\'post_parent\' => \'20\',
\'post_type\' => \'page\',
\'sort_column\' => \'menu_order\'
)
); ?>
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<li id="<?php echo $page->post_name; ?>">
<h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
<img src="<?php echo get_featured_image_link(\'Path\'); ?>">
</li>
<?php endwhile; ?>
<?php wp_reset_query() ?>
将宽度和高度设置为您想要的任何值。。。
测试和工作!
玩得高兴