Home>Support>Get the content inside the_content?

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 a free community support forum. Replies are not guaranteed. If you need professional email support, please purchase a SiteOrigin Premium license.

  1. 2 months, 10 days ago Alex S Hi, I Work Here

    Hi 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 );
    }
    
  2. 2 months, 8 days ago gcooke

    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?

  3. 2 months, 7 days ago Alex S Hi, I Work Here

    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:

    SiteOrigin_Panels::renderer()->render( $post_id )

    Generate the excerpt from that (just don’t output it).

Please log in to post on our forums. Signing up is free.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More