Skip Navigation

[Resolved] Doesn’t load standard article layout

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.

This thread is resolved. Here is a description of the problem and solution.

Problem:
I've modified my theme files to integrate "layouts": everything works, but now when I load a standard article (WP Posts) I just see the title. Is it possible that "standard" posts remain with the original layout of the theme and Custom Post Types use the Layouts created with layouts plugin?

Solution:
Yes it's possible, you need to have 2 things in your theme, two separate template files for each post type. For example if you have custom post type called “Portfolio” and a normal WP post type “Posts”.

- Posts is loading template file = single.php
- Portfolio is loading template file = single.php (yes same, as theme does not have its own template file).

So what we need to tell “Portfolio” post type, is to load its own template file (single-portfolio.php) and normal blog posts should keep loading the original (single.php) template file. To do this:

- Make a copy and rename single.php >> as single-portfolio.php template file in your theme. This should have the layouts integration the_ddlayout();
- Resave the permalinks in WP Dashboard >> Settings >> Permalinks.
- Whereas your original single.php should not have layouts integration, because now it will only be used for the blog Posts.

Relevant Documentation:
You can read more about WordPress Template Hierarchy here (Single Post): https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post

This support ticket is created 7 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 -
- 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 6 replies, has 2 voices.

Last updated by vincenzoV 7 years, 5 months ago.

Assisted by: Noman.

Author
Posts
#537033

I've modified my theme files to integrate "layouts": everything works, but now when I load a standard article I just see the title, is it normal that I no longer load the default layout?

#537108

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Default Layout setting.png

Hi Vincenzo,

Thank you for contacting Toolset support. The Default Layout should be loading, it depends how you have setup default layout. Please go to check Default layout is assigned in: Toolset >> Settings >> Layouts (see attached screenshot).

Please check your post / page templates are setup in the same way as shown in these example templates: https://toolset.com/documentation/user-guides/layouts-theme-integration/

Thank you

#537527

But I would like to see the content as per the original layout of the theme and not with a layout set by the Toolset plugin

#537617

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

layout.png

Hello Vincenzo,

You can select the option “What the theme would output” option. See attached screenshot.

As your theme is integrated, it is taking over the post content layout. If you don’t want to use any default Layout on your post then you do not need to integrate your theme and you do not need to include "the_ddlayout()" anywhere in your single.php template. Your single.php file should not have anything like this, if you see this line in single.php then please delete it (after taking backup):

<?php the_ddlayout( 'default-layout' );  ?>

OR you can replace single.php file with original theme’s single.php file.

The difference between “integrated” and “non-integrated” theme is that if theme is “not integrated” then Layout assigned on post/page only affects the content area of your post or page and not the main site design, like headers and footers and sidebars and so forth. If the theme is “integrated” then you can create and assign layout to the whole page/post like headers and footers and sidebars and so forth.

Thank you

#537682

But in fact, it's fine for me that is integrated because I want to act on the whole area, however, only on the custom posts that I will create. Instead, I would that the "standard" posts remain with the original layout of the theme that would not be overwritten by any of those created with the plugin. it's possible?

#537784

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hello Vincenzo,

Yes it's possible, in this case you need to have 2 things in your theme, two separate template files for each post type. For example if you have custom post type called “Portfolio” and a normal WP post type “Posts”.

- Posts is loading template file = single.php
- Portfolio is loading template file = single.php (yes same, as theme does not have its own template file).

So what we need to tell “Portfolio” post type, is to load its own template file (single-portfolio.php) and normal blog posts should keep loading the original (single.php) template file. To do this:

- Make a copy and rename single.php >> as single-portfolio.php template file in your theme. This should have the layouts integration the_ddlayout();
- Resave the permalinks in WP Dashboard >> Settings >> Permalinks.
- Whereas your original single.php should not have layouts integration, because now it will only be used for the blog Posts.

You can read more about WordPress Template Hierarchy here (Single Post): https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post

Thank you

#540982

Thank you very much for your help!

The forum ‘Types Community Support’ is closed to new topics and replies.