Skip Navigation

[Resolved] Pages / custom posts with header and footer of the parent layout not working

This support ticket is created 6 years, 8 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 5 replies, has 2 voices.

Last updated by Christian Cox 6 years, 7 months ago.

Assisted by: Christian Cox.

Author
Posts
#623443

I am trying to: create a page and also custom post types with custom header and footer (already created in the parent layout of a child page). When we create a new page and apply the child layout, the header and footer of the parent layout appear in the page content box and not overwrite the site's header and footer. How can we create pages and custom posts that shows only header and footer of the parent layout?
The theme we are working on is a specific theme and does not seem to have integration with Types.

Link to a page where the issue can be seen: hidden link

I expected to see: the page / custom post with header and footer that override the site's main header and footer

Instead, I got: the page shows the parent header and footer in the content area and not instead of the main header and footer of the wensite.

#623480

Hi, this is how Layouts works with most themes - the theme controls the header and footer, and Layouts controls the main content area. Most people are usually satisfied with the overall site structure provided by their theme, and they want to use Layouts to control the main content area only. If you want to control the entire site, then you can use a fully-integrated theme like Toolset Starter, or you can modify your own theme to work in the Layouts framework. Toolset Starter is probably the easiest option, since it's already coded and available here in your Account Downloads area.

If you want to create your own fully-integrated theme, we have some documentation available here:
https://toolset.com/documentation/user-guides/develop-layouts-based-themes/

#623799
row.JPG

Hi Christian,
I resolved the issue by creating an empty .php template and adding the parent/child layout on it. Now the page looks ok but ti found another issue in that page.

When we create the layout rows, Toolset adds a default "row" class that is not editable (see attached screenshot).
Is there a way to remove that "row" class because it interferes with other CSS of the main template of the website?

Thanks in advance for your help.

Franco

#624063

The "row" class is part of the core grid system used by Layouts, so removing it will most likely cause significant problems. If you plan to work around that with your own CSS, you could probably use jQuery to remove that class when the page loads, something like:

jQuery(document).ready(function(){
  jQuery('.ddl-full-width-row.row.header-row').removeClass('row');
});
#625830
custom-post-attributes.JPG

Hi Christian, thanks for your help.
We now need to apply the same parent template to a custom post instead of a page but the post still keeps the single.php template so we need to create a clone of that and tell the custom post type to refer to that clone, but how can that be achieved?

The custom post types are jerarchical posts and in the post attributes we checked "page" (see screenshot) but in the custom post type content screen we cannot select a differente template.
Any help on that?
Thanks

Franco

#625968

Check out the WordPress Template Hierarchy documentation for single Custom Post templates:
https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post:

single-{post-type}.php – If the post type is product, WordPress would look for single-product.php.

The file name format is single-cptslug.php