Plugin Author
Unyson
(@unyson)
Hello,
PageBuilder doesn’t store the value in post_content, the value is stored in post meta. Post content is replaced right before frontend display via this filter
Thread Starter
BeGie
(@artoszbka)
I understand. Will do the trick display the contents in such a manner that I want to use this filter?
Same problem here before I was using to display static page 197 on frontpage:
<?php
$sw_content = get_post_field(‘post_content’,197);
$sw_content = apply_filters(‘the_content’, $sw_content);
echo $sw_content;
?>
After updates that function stop to work Unyson can you help how the new function should looks like?
How should look like the code to display a post on the front page?
Try get_post(197)
How to use, it can you explain give example?
<?php
$sw_content = get_post(197);
$sw_content = apply_filters(‘the_content’, $sw_content);
echo $sw_content;
?>
tried but not working.
Plugin Author
Unyson
(@unyson)
$post = get_post(197);
echo $post->post_content;
<?php
$post = get_post(197);
echo $post->post_content;
?>
not working 🙁
Thread Starter
BeGie
(@artoszbka)
Worph, working. Try:
$post = get_post(19);
$post = apply_filters('the_content', $post->post_content);
echo $post;
🙂
EDIT: workinkg only default editor, no pagebuilder.
$post = get_post(19);
$post = apply_filters('the_content', $post->post_content);
echo $post;
not working 🙁
All codes work when I`m not using page builder included in unyson. When I update post 197 by unyson visual page builder, post becoming invisible on front page 🙁
Plugin Author
Unyson
(@unyson)
I am working on this now. Give me a few hours.
Plugin Author
Unyson
(@unyson)
$posts = get_posts(array(
'include' => 197,
'post_type' => 'any',
'numberposts' => 1,
'suppress_filters' => false,
));
echo apply_filters('the_content', $posts[0]->post_content);
Thank you very much it works
Is working now but I found another problem with this. Your code is adding post 197 on fronpage but also adding blank space at the top area of the post.
Plugin Author
Unyson
(@unyson)
Your code is adding post 197 on fronpage but also adding blank space at the top area of the post
I don’t understand. Can you give a screenshot?