Get the content inside the_content?
Hi,
The theme I am using uses page builder.
Is there a way to get to the content without using the the_content() function? I have tried using content_post->post_content, but the content is empty as it is outside of the wp editor. I have tried removing the filter, remove_filter( ‘the_content’, ‘siteorigin_panels_filter_content’ ); but this just leaves me with an empty the_content().
Could someone possibly guide me to getting to the content inside the page builder so I can manipulate it please…?
Many thanks,
This is our free support forum. Replies can take several days.
Need fast email support? Get SiteOrigin Premium
Replies
3Hi Gcooke,
You can use the following PHP to display the post content without using the_content() and have Page Builder display correctly (if it’s enabled for that page).
<?php $post_id = get_the_ID(); if ( class_exists( 'SiteOrigin_Panels' ) && get_post_meta( $post_id, 'panels_data', true ) ) { echo SiteOrigin_Panels::renderer()->render( $post_id ); } else { echo apply_filters( 'the_content', get_post( $post_id )->post_content ); }Hi,
Thanks for replying.
I think this displays page builder content if it is exists or alternatively displays the content.
I need to get to the content inside page builder. Basically, I want to manipulate the data inside the page builder as I have an issue with page excerpts and need to create a custom excerpt from the data inside the page builder?
Hi Gcooke,
That’s correct – that’s exactly what it does.
Regarding your question, there’s no easy way to do that. Hm, actually your only real option in that situation is to use:
Generate the excerpt from that (just don’t output it).
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.