How To Make A Custom Page Template Using Thesis

by Matt on July 18, 2009

In this video, I will show you how to create a custom page template using Thesis. In theory, this could be used on any page; I just happen to do the home page in this example. Many people have asked me how to move their blog to a different part of their site and create a custom home page or landing page (in sales). This technique is very useful for those of you who have a product you want to sell and would like your website visitors to see the product as soon as they come to your site.

Here is the PHP I used in this tutorial:

remove_action('thesis_hook_custom_template','thesis_custom_template_sample');

function sales_page() {
?>
Your custom HTML here.
<?php
}

add_action('thesis_hook_custom_template','sales_page');

Feel free to name your function anything you would like. Since this video is from a request for a guy who is trying to make a sales landing page, I just happen to name my function sales_page.

Make sure to give your page a unique custom class via the Thesis in-page options!

Also, don’t forget to either upgrade or Get Your Thesis Developer’s Package!

Please send all questions to ThesisTutor [at] gmail [dot] com!

{ 1 trackback }

{ 17 comments… read them below or add one }

Mike August 11, 2009 at 8:45 am

Great tutorial!
One thing i missing is how you can merg the content with the sidebars, so you have one contentfield on the whole page.
Thx

And keep up the good work!

Reply

Matt August 11, 2009 at 11:47 am

If you want that “effect” on every page, just set your layout to “one column.” The sidebars will appear below, much like my site.

Reply

Loren Nason August 18, 2009 at 11:38 pm

NOW i finally understand the custom templates.

Now here is my question..
If I wanted to have multiple templates do i still need to do the remove action at the beginning of each function for each custom template?

Reply

Chris September 18, 2009 at 5:49 pm

Matt – how could widgetized sidebars with different content than the default sidebars be implemented into custom page templates? I want a template for all non blog pages containing alternate sidebar content, most likely without any blog related widgets. Could the divs you setup in the template tutorial above be widgetized, or would I have to just code all the content into the functions.php file?

Reply

Matt September 19, 2009 at 2:05 am

@Chris
That is highly customized work you are asking for. Please email me and we can discuss how I can help you.
Thanks.

Reply

Emile October 19, 2009 at 1:15 pm

Matt – thank you for these tutorials. I haven’t purchased Thesis yet. But will do so through your affiliate link. You’ve done more to answer my questions than anyone. Thanks.

Here’s a question: In the video above, you pasted the divs and text into the custom_functions.php . Was this to demonstrate that you can put “whatever you want” in the custom page?

Why wouldn’t you create a custom template called “sweet sales page” then create a page in WP (assigning it to that CSS class) and then enter the div tags in the actual page as content?

I’m not sure if you’re suggesting the idea of putting actual content in the custom_functions.php file. Or if that was just a quick way to demo the concept.

Thanks again.
Emile.

PS: regarding Chris’ question. There is a plugin called Widget Logic that will enable you to set widgets to ONLY appear on specific pages, categories, posts, etc. It’s brilliant.

Reply

David October 20, 2009 at 5:52 pm

Nice tutorial Matt.

I’m trying to make some hidden pages so I can still use WP comments but I think custom templates is the way to go.

Reply

Jason November 12, 2009 at 11:27 am

Sweet Tutorial! But what if instead of a fully new template, I want to access the Thesis default template, and then just tweak it a bit. For instance, on the Thesis home page it shows featured posts and excerpts of posts. I want to keep that functionality, but I want to only show 3 posts on the home page, and then add my own content below that. I am confused as to how to make that happen. Any ideas? Thanks!

Reply

Matt November 15, 2009 at 2:56 pm

@Jason
From the Wordpress Dashboard go to Settings->Reading then set the number of posts you want to display on the blog page. To add your own content simply use the appropriate hook (i.e. thesis_hook_after_content or thesis_hook_after_content_box) and hook into place your HTML/PHP.

Reply

Jason November 16, 2009 at 10:08 am

Oh… really? That easy, huh? Thanks a lot! You may have just saved me a lot of time and anguish! Thanks!

Reply

meleighsmith November 20, 2009 at 12:56 pm

Hi Matt,
Thanks for a great tutorial! It’s amazing how easy things become when they are explained step by step.

Melissa

Reply

Mary Ann December 13, 2009 at 5:33 pm

Matt,

I want a custom page that has different content in the side bars. Kind of like having side bars 3 and 4. Do you have a turorial for that?

Mary Ann

Reply

Jo. January 22, 2010 at 6:31 am

Thanks a million… Great tutorial… Clear & Clean :)

Reply

Vincent March 2, 2010 at 7:21 am

Great tutorial – Thank you.
But… I have a question.
Using this method to customize a page is great but once you hand it over to your client, it seems that the client will no longer be able to manage the content using the admin.
Am I correct or is there a way to customize a page while keeping the WISIWG editorial functionality?
Thanks

Reply

Matt March 2, 2010 at 10:22 pm

@vincent
This is not a technique that is intended to be used as you have described. It is strictly for pages that either do not require updates or that are updated by proficient users with server side access. If you are looking to make a more ‘custom’ page that can be updated easily, I recommend using the ‘no sidebars’ template and making a design within a Wordpress page.

Reply

Dee April 5, 2010 at 4:23 pm

This was crystal clear! Thanks!

Reply

Shay June 13, 2010 at 7:41 am

Hi Matt,

Great tutorial :-)

When using remove_action(‘thesis_hook_custom_template’,'thesis_custom_template_sample’); I remove sidebars completely.
I’d like to create a custom page with the sidebars included. Actually just add different html and JavaScript inside the content column. How can I do that?

Shay

Reply

Leave a Comment

Previous post:

Next post: