Front page on Carrington theme

July 10, 2011 10:17 am 4 comments

I have decided to improve my skills creating WordPress themes, and the only thing I was sure is that I would need a theme framework in order to be organized and have a solid structure. After having a look at the main frameworks, the chosen one was Carrington. The reason, you can get a quick idea of what it does, it acts like a proxy for template parts, so if you want your home page to have a different header, you just add a new file in the headers folder called home.php and Carrington pick it for you. You can almost forget about WordPress conditional tags and if statements and focus in developing.

But that does not always work. In my case, I wanted to have a static page as home of my site, to do so I went to “Settings” > “Reading” on my WP backend and chose the page I wanted to be the home page. I also wanted a new header for this new home page, so I added the “home.php” file to my headers folder, but Carrington just ignored it.

Carrington only recognizes the home.php files as templates for your blog page, in case you want a different template for your front page you will need to create a new context. It sounds difficult, but you only will have to use this hack I leave here:

You can add the code to your functions.php file or create a new file under the Carrington’s plugin folder. Once done it, you can add files called front-page.php to your theme, and they will be picked properly.

 

javi

Let’s push your website a bit further

My name is Javier Márquez and I have more than 10 years of web programming and web designing experience. If you have a difficult development to complete, maybe you can stop by and see what I can do for you. You can find me on and Twitter.

4 Comments - Leave yours

Leave a reply


contact meAnything related to web development like javascript and CSS to create responsive designs, or PHP and node.js to make your website work properly, is my pleasure. If you have an interesting project in mind, I can help to make it real.