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:
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.