admin管理员组

文章数量:1313054

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.

本文标签: woocommerce offtopicshow content of a page built using yootheme builder on different pagetemplate