Skip Navigation

[Resolved] Understanding how layouts work

This support ticket is created 3 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 4 replies, has 2 voices.

Last updated by Kelly 3 years, 10 months ago.

Assisted by: Shane.

Author
Posts
#1629213

Can I used a layout to display my post type differently? My pages and block posts have sidebars which I want to suppress when I'm displaying content from custom post types.

My assumption was that content templates display what appear in the page/blog content sections, but the layouts affect the whole page look, but I might be wrong!

#1629297

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Kelly,

Thank you for getting in touch.

Given that you are using our Blocks plugin then you won't be able to use our Layouts plugin at the same time.

Also our Layouts plugin wouldn't be able to remove the sidebar as your theme's template is what is responsible for this. Even if you build out your page with our Layouts plugin you will still need to use your theme to disable the sidebar.

Thanks,
Shane

#1630799
postattribute.jpg

Ah! In which case, is there any way I can make a custom post type always select a specific theme template?

I've created a new theme template which I want some of my post types to use. It appears in a "Post Attributes" box in the editor, but defaults to the standard:

If not, is there a hook I can use to flip it with some code?

#1631047

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Kelly,

This will require a little coding and copying and pasting as the only way I know to make the Posts in a Post Type default to a template from the theme is to create a template and give it the filename of the Post Type slug.

Normally your Post type templates are named as single.php . If you want this template file to default to another a custom post type you will create a copy of that single.php file and name it single-{cpt_slug}.php .

If I had a Post Type called Manufacturers and the slug is manufacturers then the template name would be single-manufacturers.php

Please let me know if this helps.
Thanks,
Shane

#1631087

That worked! Means I've got to create a bunch of template files, but it's uncomplicated 😀

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.