This thread is over two years old and may be outdated. Please create a new thread if you need help, or email us if you have an active Premium license.

Multiple wysiwyg editors within custom post type having the page builder

Started

Hello!

First of all, awesome plugin guys!

I’m looking to apply the page builder to multiple wysiwyg editors within a custom post type.
Earlier I found a similar post about this: https://siteorigin.com/thread/two-sections-in-a-post-editable-by-pagebuilder/
but I need it to work without a plugin.

The setup I have is;

Single post type
http://domain/project/post/

Sub pages of the post type targeting a specific template by url rewrite;
http://domain/project/post/design
http://domain/project/post/build
http://domain/project/post/result

So I need to have 4 wysiwyg editors to display the content (1 for the regular page, 3 for the sub pages)
The regular one works fine obviously as the page builder plugin is attached to the custom post type.

I have the following code in my functions.php to create an extra wysiwyg editor;

// ADD DESIGN EDITOR
function design_editor($post) {
    echo '<h1>Design</h1>';
    $content = get_post_meta($post->ID, 'design_content' , true ) ;
    wp_editor( $content, 'design_content' );
}
add_action( 'edit_form_advanced', 'design_editor' );
function design_content_save_postdata($post_id) {
  if (!empty($_POST['design_content'])) {
    $data=htmlspecialchars($_POST['design_content']);
    update_post_meta($post_id, 'design_content', $data );
  }
}
add_action('save_post', 'design_content_save_postdata');

And I output this code in single-project-design.php like this;

$content = get_post_meta(get_the_ID(), 'design_content' , true );
$content = htmlspecialchars_decode($content);
$content = wpautop( $content );
echo $content;

Up to this point it all works but how can I apply the “page builder tab” to my design editor so the output is styled by the page builder?

I tried to be as specific as possible and looking forward to your reply.
Thanks in advance!

– Luke

This is our free support forum. Replies can take several days.

Need fast email support? Get SiteOrigin Premium

Have a different question or issue?

Start New Thread