I'm trying to make a new home page template. I copied page.php and added the usual comment to make it a template. It's in my child theme folder and in my parent theme folder. It shows up in my template list on the home page, but when I switch it, I lose all of the theme options for the home page. They don't show up in admin, so I can't edit unless I switch back to the default template.
In the very beginning of that file, you will see the following code:
var page_template_val = $('#page_template').val();
if (page_template_val != 'default'){
$('#page_settings_panel').slideUp('fast');
} else {
$('#page_settings_panel').slideDown('fast');
}
$('#page_template').on('change',function(){
$cur_val = $(this).val();
if ($cur_val != 'default'){
$('#page_settings_panel').slideUp('fast');
} else {
$('#page_settings_panel').slideDown('fast');
}
});
You will need to add your own page template file name to the list of allowed options. So for example, if your custom page template is called custom-homepage.php then you will use the following code:
Hello Boxy,
I'm trying to make a new home page template. I copied page.php and added the usual comment to make it a template. It's in my child theme folder and in my parent theme folder. It shows up in my template list on the home page, but when I switch it, I lose all of the theme options for the home page. They don't show up in admin, so I can't edit unless I switch back to the default template.
Help!
Trent Jones
This is because Forgiven hides the page settings when anything other than Default is selected. You will need to edit the following file:
In the very beginning of that file, you will see the following code:
You will need to add your own page template file name to the list of allowed options. So for example, if your custom page template is called custom-homepage.php then you will use the following code:
— Justin Scheetz
Need professional theme/plugin customizations?
Check the awesome folks at WP Kraken!
Awesome, thanks Justin!
Just replace the new with the old? Or add that at the beginning or end of the other?
Trent
Replace it with the new code. But you'll need to change the custom-homepage.php part to whatever your new template is called. :)
— Justin Scheetz
Need professional theme/plugin customizations?
Check the awesome folks at WP Kraken!