Specific custom child theme page

admin2025-06-03  3

I'm very new to wordpress and I'm still getting my head around this. So, I'm using twentyseventeen theme but I want my front page to be just a landing page with my logo and a button to press 'Go', I dont need neither header or footer.

My idea is to copy front-page.php to my child theme folder and, being there, I change the code at my will, like removing the footer caller and the navigation menu, add the background color that I want, etc. Will I have problems with updates and is that a good practice? Because by doing this I'm basically changing all front-page code. Should I, instead, try to apply filters in the functions.php and use the style.css to, for example, hide the navigation menu?

I'm very new to wordpress and I'm still getting my head around this. So, I'm using twentyseventeen theme but I want my front page to be just a landing page with my logo and a button to press 'Go', I dont need neither header or footer.

My idea is to copy front-page.php to my child theme folder and, being there, I change the code at my will, like removing the footer caller and the navigation menu, add the background color that I want, etc. Will I have problems with updates and is that a good practice? Because by doing this I'm basically changing all front-page code. Should I, instead, try to apply filters in the functions.php and use the style.css to, for example, hide the navigation menu?

Share Improve this question edited Feb 9, 2019 at 12:06 Manuel Perdigão asked Feb 9, 2019 at 11:32 Manuel PerdigãoManuel Perdigão 133 bronze badges 1
  • I guess wordpress is new to you, not tbe other way around. – Pedro Lobito Commented Feb 9, 2019 at 14:54
Add a comment  | 

1 Answer 1

Reset to default 1

You have the right idea.

Your child theme's copy of front-page.php will take precedence over the parent theme's, with no danger of it being overwritten by updates to the theme.

You will want to make sure to also create an actual page in WordPress to represent that page, and that on the WordPress -> Settings -> Reading page in the admin interface you specify that page to use as your front page. Then that page will automatically use your front-page.php for its template (otherwise it will default to showing a page of posts, i.e. home.php).

If you run into any problems feel free to post, but you are well ahead of the average WordPress first timer and are clearly thinking carefully ahead. Good job.

Edit: By the way, I would not completely remove the get_footer() call from that file. WordPress and other plugins have a general assumption that you're going to call the header and footer function and may use them to, for instance, add script dependencies. What you can do instead is specify a specific footer template file to use, i.e. get_footer( 'blank' ) which will look for footer-blank.php. Create the file but keep it minimal. You'll want to at least close out any open HTML elements. But you don't have to do anything else with it. The same practice goes with the header, although there you'll at least want to do some basic framing structure for your HTML.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1748924972a314868.html

最新回复(0)