show content of a page built using yootheme builder on different page/template
Question
I have a WordPress page built using Yootheme builder.
I want to show the content of that page on woocommerce Category page.
namespace YOOtheme;
global $post;
$post = get_post(2434);
setup_postdata( $post );
get_header();
$config = app(Config::class);
if ($config('app.isBuilder')) : // returns NULL on woocommerce page
echo get_section('builder');
elseif (have_posts()) :
setup_postdata( $post );
get_template_part('templates/post/content', 'page');
endif;
get_footer();
My concern is :
$config(‘app.isBuilder’) returns null on the woocommerce category page.
but on the original page it returns true and get_section(‘builder’) returns the correct data.
Otherwise, content is returned but correct CSS classes are not added to the content.
I tried:
$content = $post->post_content;
$content = apply_filters('the_content', $content);
$content = str_replace(']]>', ']]>', $content);
echo $content;
But then again i get the content of page but not the correct dynamic CSS classes.
0
2 months
0 Answers
12 views
0
Leave an answer
You must login or register to add a new answer .