Automatically setting a layout for a custom post type?

Hi guys,

I’m entering territory as yet unexplored so forgive me if something here sounds a bit noobish.

What I’m trying to do is create a custom post type lets call it ‘Staff members’.

I register the taxonomy, and create a .php file to use as the template.

Normally if it was just regular old wordpress, my understanding is that I apply all design and nuances to that new php template file. So that ANY ‘Staff’ posts that are created, all have their custom post data and title and what not all put in somewhere in the template file. So Staff1 would look pretty much the same as Staff2 etc.

But this is not regular old wordpress, this is Beaver Builder.
Normally the page builder handles edits on a per-post basis and only on the content areas.

So my question is how do I go about automatically applying a particular BB Saved Layout to the new staff template?

The way I want it to work is in Beaver Builder I spend some time creating a nice looking layout, and I will create a few custom modules which will gather the post data. Any custom field data and put it all in the right place.
Then since all the post data is generated different for each Staff member, the same template can be used on every staff member. Thus more of a template style of behaviour.

So, is there a way I can automatically apply this Saved BB Layout as the default for the StaffMembers template?

Cheers and let me know if I’m missing something or you need more info

Hey Jay,

That should be possible if you’re creating custom modules to pull in post meta data. Simply create your layout via BB with all the custom modules in place. To call the layout template from your PHP file, you can either use the shortcode method or render_query method.

Hope this helps and let us know if we can assist further! :slight_smile:

Ben

Oh I see - that’s a novel solution isn’t it.

So instead of directly applying the bb page layout to the page - you simply make the template render the appropriate Layout.

Ok, so since I’ve got you talking, what if I DO actually want to customize something on a per-page basis?

For example a regular blog page would just display blog content. but if you go into the bb-edit screen and save, it will let you make customizations to the content area.

How would this behave if I rendered the layout using a shortcode or render_query? Is the content area non existant? Is the rendered layout completely non-editable?

Hey Jay,

Sorry, it seems I’ve replied a bit too early! It looks like this won’t be possible via the shortcode or render_query method. But is via Global Rows. Check out Justin’s reply on the thread below for more info. The thread discusses a similar method.
http://forum.wpbeaverbuilder.com/support/q/global-layout-for-custom-post-types-and-custom-fields

Also, to answer your question above, rendering a layout via render_query allows you to edit the layout while it doesn’t via shortcode. :slight_smile:

Ben