Getting BB-Page Content for a Post

Hi,

i really hope, i did not miss a answer for that problem in the forum.

I want to use BB also for custom Post Types. But as a Template.
So i created a Page with BB with my custom modules inside. e.g. “Books”

Now if a single book should be displayed, i want to render the general “Books” Page with the generic modules, wich show e.g. the book title.

When i try to get the content of a page build by BB, i get another HTML then i expected.
e.g. the result of a headline in BB is

<div class="fl-module-content fl-node-content">
  <h3 class="fl-heading">
   <span class="fl-heading-text">Abschnitt</span>
  </h3>	
</div>

when i get the content of that page by
$page = get_post($pageId); $content $page->post_content;
its only:
<h3>Abschnitt</h3>

so, how can i render a page for a single post?

That would be amazing :slight_smile:

thx

Hey Philipp,

You may need to load that post’s CSS/JS files using our fl_builder_global_posts filter. Check the link below for more info. :slight_smile:
http://forum.wpbeaverbuilder.com/knowledge-base/filter-reference/

Ben

Hey Ben,

thx for your reply. I already did that, so i have the correct css and js loaded.
This is not the problem.
The created content is not the same.
I think, that BB is not doing the processing. so i just get the normal page content but not the generated one.
so, how can i cat the HTML processed by BB instead of saved HTML of the page.

Thx :wink:

Hi Philipp,

Beaver Builder’s content is only rendered within a loop using the_content function. Doing $page->post_content; won’t work because that variable hasn’t run through WordPress’ content filter. Here’s an example loop using the_content function…

query_posts( array(
    'post_type' => 'page',
    'p' => $pageId,
) );

while (have_posts()) : the_post();
    the_content();
endwhile;

wp_reset_query();

Let me know if you have any questions about that.

Justin

Hey Justin,
i really thought, i started in that way… hm.
now i works, maybe in a combination with other changes.

thx a lot, with with possibility, BB is more powerfull :slight_smile:

Philipp

You’re welcome, Philipp!

Justin