-
AuthorPosts
-
May 3, 2020 at 4:08 am #1209210
Hello,
I have created a page in Enfold and I would like to transform it into a template so that to use it as a template for other pages.
Could you tell me how can I do it ?
Thanks
LuluMay 4, 2020 at 4:38 am #1209391Hey Lulu,
You can save the layout as a template in the top right hand corner of the Layout Builder window, or you can use the Page Content element to load your layout in more than one place. The Page Content element will update your content globally, but the template which you save and load in the top right hand corner will not update globally.
Best regards,
RikardMay 4, 2020 at 7:46 am #1209439Hi Rikard,
Thank you for your prompt response. Presently there are 3 templates in Enfold: Archive, Blank and default. What I would like to do is create a 4th one based on my page.
I have tried saving my page as a template but it doesn’t really work for my purpose because the template doe not appear in the template options. Then if I use the page content element, it is just like an iframe, it’s not a template. Is there a way I could create a real template that would appear in the template options ?Kind regards
Lulu
May 9, 2020 at 3:29 pm #1211401Hi Lulu,
You can try to copy this file /enfold/template-blank.php
rename it to template-custom.php and make your changes in the new file.
Best regards,
VictoriaMay 9, 2020 at 9:50 pm #1211510hi Victoria,
Thank you very much indeed.
So, just to be sure : I just have to replace blank by custom in the template, like this:
<?php
/*
Template Name: Custom – No Header, no Footer
*/if ( !defined(‘ABSPATH’) ){ die(); }
/*
* A custom Template that allows you to build landing pages, coming soon pages etc
*/global $avia_config;
$avia_config[‘template’] = “avia-custom”; //important part. this var is checked in header and footer php and if set prevents them from rendering. also an additional class is applied to the bodyif(!empty($avia_config[‘conditionals’][‘is_builder’]))
{
$avia_config[‘conditionals’][‘is_builder_template’] = true;
get_template_part(‘template-builder’);
exit();
}
else
{
get_template_part(‘page’);
exit();
}Best
Lulu
May 10, 2020 at 2:21 pm #1211647Hi Victoria,
Please disregard my previous question, it’s all ok.
Thank’s again
LuluMay 13, 2020 at 11:08 am #1212562 -
AuthorPosts
- The topic ‘Creating custom page template’ is closed to new replies.