I’ve just finished coding a custom home page template for the Minimum Pro theme by StudioPress.
Here’s what it looks like:
Rather then send emails back & forth to my client, i thought i’d share all the code with the people who subscribe to my blog.
Here’s all the PHP code for the front-page.php template:
Note: Please copy from the view raw link and paste using a code editor like Notepad++.
And here’s the code for your child themes functions.php file:
On top of this i have also added the conditional tag to the existing code for the sites tagline. You can simply add the conditional below the function. Here’s what the full code snippet should look like:
And now for the CSS code which you should add at the end of our child themes style.css file before the media queries.
Mobile Responsive Design
Here’s the CSS for media queries which should be added at the absolute end of your child themes style.css file:
You can tweak this CSS if you want your home page to look different on different sized screens.
Pro Tips
The sidebar for this template uses the default primary sidebar so you may want to display different widgets on the home page to whats shown elsewhere. Simply install the Widget Logic plugin or one of the other plugins which do the same thing and add conditional tags to each sidebar widget.
Remove the 2 lines of PHP code for adding new image sizes from your functions file (after generating your images) if you only want the same image to display on the home page.
You can easily remove the code for Backstretch however there’s no real need as it doesn’t fire unless you’ve added a background image via the built in Background function.
Conclusion
As you can see, i only added 2 lines of CSS code. One to hide the primary nav menu and another to add some margin for the banner which you may not need if you don’t want to add a banner.
I did modify the media queries as there’s only 2 home featured widgets now so there’s less CSS code.
There’s actually less PHP code for this custom front page template than is used in the original template.
Please let me know what you think and i always love any type of real feedback.
Was This Tutorial Helpful?