I'm trying to create a second instance of the home page that contains the same content as the actual home page. The actual home page includes some shortcodes, and they fail to convert from the shortcode to the actual replacement content on the second home page.
Here is my function for my shortcode to make the actual home page appear in the second home page:
/* Load home page content into second version of page via shortcode */
// [home2]
function second_home_page( $atts ) {
$post_8 = get_post(8);
$content_8 = $post_8->post_content;
print $content_8;
}
add_shortcode( 'home2', 'second_home_page' );
That worked, except that the shortcodes didn't fire in the second home page. Instead, I simply see entries like [shortcode] in the text of the live page.
So, I tried to add a filter to my function, like this:
/* Load home page content into second version of page via shortcode */
// [home2]
function second_home_page( $atts ) {
$post_8 = get_post(8);
$content_8 = $post_8->post_content;
add_filter( $content_8, 'do_shortcode' ), 11 );
print $content_8;
}
add_shortcode( 'home2', 'second_home_page' );
However, this results in not only the shortcodes from the actual home page failing to fire on the second home page, but it also prevents other short codes associated with the template from firing as well.
Can someone tell me how to fix this?