admin管理员组文章数量:1313241
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
版权声明:本文标题:woocommerce offtopic - show content of a page built using yootheme builder on different pagetemplate 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741926077a2405294.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论