我正在尝试创建显示所有子页面的visual composer扩展。
不知何故,它只显示“Array”。
有什么想法吗?
function childpages_func( $childpages = \'\' ){
$childpages = get_pages(\'child_of=\'.$post->ID.\'&sort_column=post_date&sort_order=desc&parent=\'.$post->ID);
foreach($childpages as $child){
"<div>
<a href=\'.get_page_link($child->ID).\' title=\'.$child->post_title.\'>
<img src=\'.wp_get_attachment_url(get_post_thumbnail_id($child->ID)).\' title=\'.$child->post_title.\'>
</a>
</div>";
}
return $childpages;
}
/* Display Child Pages */
function vc_doo_clip_child_pages_func( $atts ) {
extract( shortcode_atts( array(
\'cp_header\' => \'cp_header\'
), $atts ) );
$end_content = \'<h2>\'.$cp_header.\'</h2>\'.childpages_func().\'\';
return $end_content;
}
任何帮助都将不胜感激;)谢谢