Home>Support>How to get several pages with Page Builder content on one page?

How to get several pages with Page Builder content on one page?

Notice: This thread is over two years old; the information may be outdated. Please consider creating a new thread if you require free support. If you have an active SiteOrigin Premium license, you can email our premium support desk at [email protected].

Hello,
Thank you, Page Builder is really awesome!

For my custom theme I need to show all pages on frontpage in some order. Also I need to filter page content to convert short code to real HTML. My code (bellow) is working fine with default WP editor, but don’t show anything with Page Builder content (actually any PB page is showing as it’s last state from the default editor).

How to properly show Page Builder pages in custom query?

Here is my code (simplified):

global $page;
$args = array(
	'sort_order' => 'ASC',
	'sort_column' => 'menu_order, ID, post_title',
	'hierarchical' => 1,
	'exclude' => '',
	'include' => '',
	'meta_key' => '',
	'meta_value' => '',
	'authors' => '',
	'child_of' => 0,
	'parent' => -1,
	'exclude_tree' => '',
	'number' => '',
	'offset' => 0,
	'post_type' => 'page',
	'post_status' => 'publish'
); 

$pages = get_pages($args);

foreach( $pages as $page ) {
	$content = $page->post_content;
	$content = apply_filters( 'the_content', $content );
	?>
	<div class="section <?php echo $page->post_name; ?>">
		<div class="entry"><?php echo $content;?></div>
	</div>
	<?php
} 
wp_reset_postdata();

I found theres similar topics, but unfortunately without straight answers:

Page Builder conflict with apply_filters the_content

Page builder not outputting anything

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 9 years, 3 months ago Alex S
    Hi, I Work Here

    Hi Vovkasolovev,

    I’m actually not sure how to query it directly as I can’t work it out either. :S I’ve forwarded your thread onto the development team to hopefully find an answer.

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More