I would like to use a layout what I created in Layouts for my Home page - what I set as a static home page for my site.
I created the layout.
I set the layout to be used on the Home page.
But when I go to the Home page, it says there is no layout available. I actually see this Layout template file not available message on ALL my pages.
Am I missing something? It's driving me crazy....
Welcome to Toolset support forum,
Maybe your theme's page.php file is not ready for Layouts and you need to do some customisations. You need to replace the standard WordPress loop with Layouts. For this purpose you need to edit your theme’s template files and replace the have_posts() loop with a call to the_ddlayouts(). Look for:
while ( have_posts() ) : the_post();
…
endwhile;
With:
You can find more information here:
https://toolset.com/documentation/user-guides/layouts-theme-integration/
I hope it points you into the right direction.
Regards,
Andrés
Actually I suffered with the integration for like 4 days, and then beda.s gave me this info in another post: https://toolset.com/forums/topic/please-make-layouts-integrations-code-change-more-clear/
I made the integration based on this, and sometimes I see layout content appearing in my pages, but I never see anything else but that message in the Layout sidebar widget in my page admin.
My page.php looks like this now:
<?php
/**
* The template for displaying all pages.
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages
* and that other 'pages' on your WordPress site may use a
* different template.
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package limm
*/
if ( defined( 'WPDDL_VERSION' ) && is_ddlayout_assigned() ) : // if Layouts Plugin is active and a layout is assigned
get_header( 'layouts' );
the_ddlayout( 'page-default' ); // Loads 'page-default' layout by default
get_footer( 'layouts' );
else: // if not use the normal WP loop
get_header();?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'template-parts/content', 'page' ); ?>
<?php
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
?>
<?php endwhile; // End of the loop. ?>
</main><!-- #main -->
</div><!-- #primary -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
<?php endif; ?>
Any hints? thanks.
Alright, so, I decided to go ahead and give you an opportunity to check out my page for real. I made a version live on the server and I created an access to it. I made the simplest form of Layouts integration there, and it still gives me the same message.
Please enable private for my next comment and I give you access, you can see what is going on, and I really hope you'll find the solution. Thanks.
Can I ask for a temporary access to your site? So I can look for more details.
I have enabled your next reply as private, please input all details in that area. Please mention the links to the pages, views, forms, CPTs and configurations in question.
*Important: Please take a complete backup of your site, before proceeding.
I was checking this situation and I understand why you were confuse. With your theme, you can't change your layout from the your Editor page. However if you go to your Layouts page, you can see how you can assign different layouts to your pages.
For example, there If create a Layout called "WPML test page layout" and I assign it only to my WPML test page, nothing fancy for just for the matter of illustrating. Your "Page content" Layout is being applied correctly but the warning on your editor page could be misleading. Now you can continue editing your Layout.
The main thing is that the integration was actually correct. Thanks for checking it out andres.