Skip to content

Instantly share code, notes, and snippets.

@celticwebdesign
Created September 17, 2017 21:00
Show Gist options
  • Save celticwebdesign/025d8a05265e72bc829e794a82c93f58 to your computer and use it in GitHub Desktop.
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.
<?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