Created
September 17, 2017 21:00
-
-
Save celticwebdesign/025d8a05265e72bc829e794a82c93f58 to your computer and use it in GitHub Desktop.
Working with Visual Composer, get the content of one page and show it on another page, includes inner page css.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( get_field('above_footer') ) { | |
$post_id = get_the_id(); | |
} else { | |
$post_id = 41; | |
} | |
$vcM = Vc_Manager::getInstance(); | |
$vc = $vcM->vc(); | |
$vc->addShortcodesCustomCss( $post_id ); | |
$post = get_post($post_id, OBJECT); | |
$content = $post->post_content; | |
$content = apply_filters('wpautop', $content); | |
$content = str_replace(']]>', ']]>', $content); | |
setup_postdata($post); | |
WPBMap::addAllMappedShortcodes(); | |
echo apply_filters('the_content', $post->post_content); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment