Guys,
I know I’ve asked before, however, can I just run through with you to check if I’m creating custom post types with BB integration the correct way?
To start I install my custom post type plugin
Create a custom post type (as usual) say Movies and a couple of entries/posts
Then I copy from the BB theme file folder the single.php file and place that copy in my child theme folder
I then rename the file (in this instance) single-movies.php
and add the following code if I want a blank movies post page:
<?php
/*
Template Name: Movies
*/
?>
In setting - page builder I tick to allow BB page builder to work on newly created post type (movies)
In my Movies sample post I then launch page builder and this takes me to my movies post blank page
Would you say this is the best or most economical way to create and use BB with a custom post type?
This should make your Movies CPT have the same layout as your pages. If that’s what you wanted to do then you’re on the right direction. You should still be able to use BB with CPTs without having to do all that.
okay Ben - will stick to previous mentioned method to allow for custom styling of posts using BB - think I’ll create a series of snippets in order just to be able to paste into new custom post type template files in future
Have a great weekend - love the latest beta version btw
the code you have above that goes into your single-movies.php file in the child theme, you replaced the code in the single.php file with the code above, correct?
Replacing your single.php file will affect all posts, be it the regulars posts, or CPTs. If you want to only adjusts a specific CPT, then you can create a new file, e.g., single-movies.php like the CPT above, and it will only affect that. Check the codex below for more info. https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
Hey Ben! I don’t think I was clear. Here’s all I have done.
Installed/Activiated ‘Portfolio post type’ plugin.
Created a single-portfolio.php file in my child theme.
Copied the code from above into that file and replaced the template name with portfolio.
Created a new portfolio item. It lets me select the ‘page builder’ but once I’m there, it won’t actually let me add any rows or modules.
Now, I know I’m missing something, because when I add a ‘new page’ and edit that page, I can select portfolio from the templates. I don’t need that functionality, I need the portfolio items themselves to be editable using the BB page builder.
I’ve just performed some test on your Website and it seems everything is working fine on my end. I’ve created a BB test page here for your reference http://cmd.creativeministrydesign.com/portfolio/bb-test-page/ , I’m able to insert rows and modules without issues. Could you please try it on your end? Let us know how it goes.
KC, I know how to get the page builder to work on the portfolio item. I can’t get the page builder to work like it would on a regular page. That is my issue.
Sorry, I’m not getting this. Could you tell me a little more about the problem that you’re having? I’m able to use the page builder without issues on your portfolio items. Could you tell me which module is not working for you? Let me know if I am misunderstanding your question.
I want the page builder to operate on a portfolio page the same way it would on a regular page. No sidebar, no titles, not meta data, ect. Just fullwidth page builder.
If you could read my post in this thread from 8:12 on Jan 11 it will tell you what I’ve done so far.
I apologize for the misunderstanding there. Just took a look at the single-portfolio.php file and it seems it is using the content-single.php file on your parent theme to display the layout. Lets try creating a custom layout content-portfolio.php in your Child Theme and change the code as shown below on the single-portfolio.php file.
With this <?php get_template_part('content', 'portfolio'); ?>
Once you’re done, we’ll start customizing the content-portfolio.php file, such as removing the sidebar, titles and etc. Give it a try and let us know if it works.
Hi, I am seem to be having a similar problem to the guys above.
I am using the BB child theme.
I have created a CPT called ‘rooms’
I want my regular ‘single’ posts to have a sidebar right (Therefore I have selected that default setting in the customiser.)
However, I would like my CPT ‘rooms’ to have no sidebar.
The only way around that would be to create a new template for your Rooms CPT. It should be pretty quick on your case.
Copy the single.php from your parent theme and paste it to your child theme.
Rename the file to single-rooms.php. This makes it so that the Rooms CPT will follow what's inside that file instead.
Open up the file, and remove all FLTheme::sidebar instances, there should only be 2, left and right.
That’s the theme modification method to get it done which is what I would suggest. Another method would be via CSS. If you can share a URL where we can see your Rooms CPT’s frontend, I can provide you with the code.