I would like to get show multiple page's content on one page with shortcodes. If I use return $html;
the shortcodes not working, if I use return do_shortcode($html);
the shortcode working, but the content of the page dissapear. What is the working solution?
function get_page_func( $atts ){
extract(shortcode_atts( array(
'title' => ''
), $atts ) );
$page = get_page_by_title($title);
$args = array(
'include' => $page->ID,
);
$pages = get_pages($args);
$html = $pages[0]->post_content;
return do_shortcode($html);
}
add_shortcode( 'get_page', 'get_page_func' );
echo do_shortcode($html)
the shortcode content is on the top of the page.return do_shortcode($html)
the page render only the shortcode's output, without the content on the page.