Custom Theme Page Template
Custom Wide Page Template for SME Tech
Today was spent creating a custom page template for one of my websites – SME Technology – to use a wide format for single column, no sidebar pages.
WordPress Custom Pages Easy
It’s quite easy to add a custom page to a WordPress theme… At least if an existing page template is used. This time the main goal was to use a custom style sheet to increase the page width and reduce white space between the header menu bar and the page title.
To get this right, I had to use a custom header.php file with the custom page template. Again, the theme header.php was the basic file, the only change being the link to the new style sheet.
For some reason getting a relative path to the stylesheet gave the most trouble. Maybe I’ve just got used to using full urls for stylesheets coding, and don’t usually worry about relative paths – why bother if the stylesheet is only used on the site it’s designed for. This time I wanted to package the template files for a download for other users, so a relative path was needed.
Design Road to Custom Page Template
I had already tried the guide for the theme to increase page width, but for some reason the ways described didn’t work for me – or didn’t give the result I wanted.
At first I modified the parent theme stylesheet to get the layout I wanted – and would have left things this way except… changing the spacing for the header messed up some other layouts – so a better method was needed, and the custom page template was developed (if modifying an existing template can really be called development).
Finally, with some spare time in hand, the template got finished and installed on the site. Now of course I need to change the pages to use this template, and can eventually replace the modified theme stylesheet with the original.
WordPress Custom Page Related Articles
- Custom Full Width Page for NomNom WordPress Theme (tech.graphicline.co.za)
- How to create custom template for wordpress from scratch (daniweb.com)