Page builder default post type layout
Hi!
Is it possible to choose a default layout created with the page builder for all posts of a certain post type? If not, are you planning on adding this functionality?
If I choose a layout for each post and later change my mind about the layout it seems I have to go through every post which is too troublesome if I have like 1000 posts..
This is our free support forum. Replies can take several days.
Need fast email support? Get SiteOrigin Premium
Replies
3Hi bibbelibo
There is unfortunately nothing like this in Page Builder or in the pipeline at the moment. You can use Prebuilt layouts to clone existing Page Builder layouts. We’ll keep your feedback in mind moving forward. Thanks for sharing it with us.
I was thinking something simple like hooks that lets me decide where the panels data is saved to and where it’s fetched from so that I could for instance have one row for each post type in the options table instead of one row for each post in the postmeta table.
This seems to be doing what I want :)
function my_update_panels_data( $meta_id, $object_id, $meta_key, $_meta_value ) { if( $meta_key == 'panels_data' ) { $post_type = get_post_type( $post_id ); if( $post_type == 'my_post_type' ) { update_option( 'my_post_type_panels_data', $_meta_value ); } } } add_action( 'update_post_meta', 'my_update_panels_data', 10, 4 ); function my_add_panels_data( $object_id, $meta_key, $_meta_value ) { if( $meta_key == 'panels_data' ) { $post_type = get_post_type( $post_id ); if( $post_type == 'my_post_type' ) { update_option( 'my_post_type_panels_data', $_meta_value ); } } } add_action( 'add_post_meta', 'my_add_panels_data', 10, 3 ); function my_delete_panels_data( $meta_ids, $object_id, $meta_key, $_meta_value ) { if( $meta_key == 'panels_data' ) { $post_type = get_post_type( $object_id ); if( $post_type == 'my_post_type' ) { delete_option( 'my_post_type_panels_data' ); } } } add_action( 'delete_post_meta', 'my_delete_panels_data', 10, 4 ); function my_get_panels_data( $panels_data, $post_id ) { $post_type = get_post_type( $post_id ); if( $post_type == 'my_post_type' ) { return get_option( 'my_post_type_panels_data' ); } return $panels_data; } add_action( 'siteorigin_panels_data', 'my_get_panels_data', 10, 2 );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.