Bug when saving Cusom Post Types in Pro

When using the plugin - https://wordpress.org/plugins/custom-post-type-page-template/

(This is used in conjunction with Learndash to allow Pro to edit the courses and lessons and to add a custom sidebar to the page)

I can save a template in the WordPess backend and it fine, however. When I save anything in pro it defaults to Default Template and does not save the page template that was selected.

This basilcally means that I need to edit in WordPress, select the page template I want on the custom post, then edit the post in Pro, save it and then revisit the WordPress backend to change the default template back to the custom one I selected.

Hi there,

mmm… There is a clog icon in the Cornerstone at the left section of the screen which opens up the same functionality in the Cornerstone itself. Would you please kindly check that option?

See if you see the same problem there.

Thank you.

Here are two images.

1, from the WordPress backend and the second from Pro

To me it looks like pro is not recognising the settings from the plugin mentioned above as it does not give the ability to edit the page template (probably because it classes learndash as a custom post and not a page.

I know that you cant edit the templates of posts as standard which is why I used the above plugin, it allowed me to create a page template that has a new sidebar for Learndash and my outcome here is simply to get Learndash to show a custom sidebar. I’ve been using this workaround on X for years and hoping that one day it gets integrated into Core as so many people are building online courses these days.

Hi there,

Would you please kindly give us the exact steps you take with screenshots so that we can understand what is the actual problem? Page Templates are supposed to work with pages and not Custom Post Types. I am not sure what is the issue here. What would you do if it was a normal WordPress theme? I want to know the exact case to be able to provide a full report to the development team if needed.

I also need to have the URL/User/Pass of your website to be able to test the steps you will mention in the reply. Kindly add the credentials using the secure note.

Thank you.

The problem is not having the ability to use templates with custom post types.

Im afraid I can’t share login details but you can easily replicate in a localhost enviroment using the plugin mentioned above.

Here is a quick video to help show the problem in more detail

https://monosnap.com/file/VDyyrNy052hl68XN9t1ujMmEkqzbNc

Hi there,

Thank you for your complete video. I replicated the same case without the plugin you have mentioned but with pure code.

I added a custom post type. And added a Page Template for the custom post type by copying one of the page templates and adding the code below:

// Template Name: BLABL!
// Template Post Type: post, page, product, blabla

The first line is the name of the page template and the second line is saying to make it available on which post type. My post type name was blabla.

I enabled the Pro Builder there and it worked without a problem and it does not reset the Page template. So the problem is the way the plugin you used adds the custom post type template. I suggest that you use the native WordPress way:

Another point I can mention is the reason you wanted the post template. I suggest that instead of that you add a sidebar using the Appearance > sidebars menu. For more information:

But you do not have an option to assign the sidebar to the Custom Post Type. You will need to follow the method below:

But in the code instead of using the is_single use the is_singular('blabla'). Instead of blabla add the cutom post type name you have.

Thank you.

FYi - I worked around this aswell but I changed the FTP files

So rather than having template-lesson.php I changed it to single-sfwd-lessons.php and now it overwrites the default Learndash CPT

Thank you for your quick replies.

Glad to hear we managed to help!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.