1

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 guess wordpress is new to you, not tbe other way around. – Pedro Lobito Feb 9 at 14:54
0

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.

  • I really appreciated your answer and what you added, in the edit part, is what I was looking for without being aware of it. I will try it and if i run into problems I will post it. – Manuel Perdigão Feb 9 at 12:32
  • Sorry to bother you here but I'm facing a problem and nobody seems to believe me. The thing is that when i put a img with 200px width inside a div with 100px width and set the div overflow to hidden it doesnt work, resizing my image width to 100% of the dov width. Do you have any idea why it happens? I'm using 2017 theme. I'm really desesperated to find a answer. – Manuel Perdigão Feb 14 at 10:54
  • I have commented on your question about this. – tmdesigned Feb 14 at 11:16
  • Thanks for your time to try to understand my problem, I was with 16 hours straight of wordpress in my shoulders and my concentration was absolutely zero. The next day I tried again and found that I should have worked with the parent elements of the img and not with the img itself to not conflict with wordpress. I ended using a Grid and it works flawlessly. Thanks again for your attention, have a great day. – Manuel Perdigão Feb 16 at 8:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.