I'm trying to create visual composer extension that displays all the child pages.
Somehow it only displays "Array".
Any ideas?
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;
}
Any help will be greatly appreciated ;) Thanks!