Thesis Tutorial: Multiple Custom Page Templates

Featured Image

I have been working with Thesis for a little over a month now. Thesis is a relatively new templating platform for WordPress. Thesis has unmatched SEO, cross-browser compatibility, and top-notch HTML + CSS architecture. This website runs on Thesis.

I was looking through the Thesis forums and tweeting with others on how to get a solution to an issue. The issue has to do with creating custom templates. I want a custom home page design. I also want a custom template for other pages. Basically I want multiple custom templates available under one design. I have tried to explain what I have found below. I welcome your comments and ideas. There may be other ways to do this (usually is) but here is how I did it. Hopefully this can help others.

A Little Thesis Primer

If you are familiar with Thesis you can probably skip to, "Getting To It." The way Thesis works is to keep all customization inside of one folder--that is part of its genius. Whenever the templating system is updated you overwrite the entire file structure, save your custom folder, and replace that back in and voila you have arguably the best templating system under the hood while keeping your design in tact. This may not seem like much to the layperson, but for those of us that design and develop web sites on platforms like WordPress it is a godsend.

So back to multiple custom templates inside of Thesis.

All of the custom files sit within one folder in ~/wp-content/themes/thesis/custom/

Image of folder structure of where custom files sit inside Thesis

Every customized design using Thesis has their custom templates, css, and images stored within this folder.

To create custom page templates you need to use Thesis' ingenious "hook" system that allows you to tinker with the components of any part of the standard layout or, if you are brave, roll your own layouts and custom designs. The best entry-level instruction I have found for understanding and using "hooks" is at the web site of Sugarrae: here it is.

Once you have the basic understanding of "hooks" under your belt, have your designs ready to go, and have some WordPress chops, you are ready to create multiple custom page templates.

Getting To It

First thing you need to do is make sure you have your "home page" set to really be the home page. Whenyou are logged in as the admin go to settings/reading. "A static page (select below)" should be set to your homepage. See this image:

homepagesettings

Once I have done this I then need to make sure I have selected the "Custom Template"option from the drop down menu on the right side when you are editing any page (not posts!):

picture-2

So, first I want a custom home page template.

In the file thesis/custom/custom_functions.php I added:

/* HOME PAGE CUSTOM TEMPLATE */

function home_pagecustom() {
/* check to see if homepage. has to happen inside the function */
if (is_home() || is_front_page())  {
?>
...Your custom layout goes here...
<?php } }

/* Now we tell Thesis to use the home page custom template */

remove_action('thesis_hook_custom_template', 'thesis_custom_template_sample');
add_action('thesis_hook_custom_template', 'home_pagecustom');

The code above has been whittled down to show only the essential code. It works to display a custom home page as long as you have selected "custom template" from the pulldown menu when editing the 'home' page.

You may insert any HTML and style it in the custom.css file. Be sure to save custom_functions.php and custom.css and upload to your ~/wp-content/themes/thesis/custom/ directory.

One Custom Page Down.
How About A Second?

So how do you add another custom template after defining the home page template?

You need to define another function for your next page template. You can add as many functions (think page templates) that you like. Each one needs a unique name. You also need to define the conditional properly. You need to make sure that the conditional is within the function—it will not work outside of it.

Use the right *if* statement to make sure you apply the right template to the right page. I typically put the page tag and the page ID—a type of insurance. You can find a page ID by hovering your mouse over the link to edit the page when viewing a page list within the admin area of WordPress.

This example below is testing for the "press page" and if it is, puts the WordPress content on the left side of the page and both sidebars to the right:

/* CUSTOM PRESS TEMPLATE */

function new_presspage() {
if (is_page('press') || is_page('512')) { ?>

<div id="content">
<div class="post_box">
<div class="headline_area">
	<h2>Your Headline</h2>
</div>
...This is where your content goes...
</div>
</div>
<div id="sidebars">
<?php thesis_build_sidebars(); ?>
</div>		

<?php } }

add_action('thesis_hook_custom_template', 'new_presspage');

Since you already invoked the "remove_action" on the 'thesis_hook_custom_template' in order to replace the home page first you do not need to repeat it.

The example above looks exactly like the standard content column on the left with dual sidebars on the right. I used a custom template in this instance because I wanted to perform specific calls to the database and produce specific lists of posts. Since I am doing it this way I also create the ability to style the page however I like through the use of creative CSS implementation.

Wash, Rinse, Repeat

You could then repeat the code above and apply it to any number of specific custom templates you would like. All you need to do is

  1. create a unique function name
  2. reference the right page in the conditional
  3. make sure conditional is within the function
  4. place whatever content you would like within the proper divs
  5. style the content within the custom.css file
  6. make sure your page within WordPress has the custom template selected as its template option
  7. test, test, test

That's it. This tutorial should get you well on your way to creating multiple custom page templates within the single custom_functions.php file. If you have any questions, comments, or suggestions I welcome them below.

Hope this helps.

--

This article is translated to Serbo-Croatian language by Jovana Milutinovich.

Comments
Jess
Thanks so much for the awesome tutorial!
Paul Chamberlain
Hey – great tutorial – really helping me get through this project I inherited. However, I can’t get my loop to work in my custom_functions.
Here’s my code:
/* CUSTOM VIDEO TEMPLATE */function new_videopage() {if (is_page(‘videos’) || is_page(’42’)) { ?>            <img src="” alt=”” width=”138″ height=”77″ />            <?php } }remove_action('thesis_hook_custom_template', 'thesis_custom_template_sample');add_action('thesis_hook_custom_template', 'new_videopage');
All I'm getting is one post but there are definitely more posts of that category in the system.
Any ideas you might have would be greatly appreciated!
-Paul
this is cool. I’ve been looking for a way to code custom page templates for three or four custom post types. It’d be interesting to see your take on performing that task.
 
I love thesis theme Lic. That was some good tips and info. 
Paul
The implementation of Step 4 (place whatever content you would like within the proper divs) of the “Wash, Rinse, Repeat” loses me, because when I use my own custom function for a page template, I still need a way to reference the database-housed content of the post, as opposed to replacing all page content. My goal (and that of this article) is to write custom page templates, not custom pages. When I use thesis_content_area(); to try and reference the CMS / database side of things, the content repeats many times, see screenshot: http://screencast.com/t/vLm0Tk1O82GR
Love the tutorial, as it really cleared up some major Thesis questions, but some help on this would be much appreciated!
@Paul. Could you send me your function(s)? If I see them I can see what’s going on. Thanks,
Bert
mediamarkreno
Tons of insight and specific detail. Exactly my needs. Much gratitude and kudos. A new disciple! And thanks.
Chloecohen01
Hi – this was great and easy to implement. Is there any way to create a custom template, so when you choose from the dropdown it would say “default/custom/archive/shop/directory/portfolio”??
The reason I ask is that I have 4 main templates I need to build out for my website, with that in mind each template will be used multiple times across the board- and that would be way too much code to place within custom css and function.
Have an idea of what I’m asking? I’d even (if possible) like to take it a step further by configuring the actual page fields, so when I select “portfolio template” it will automatically include: “title/desc/gallery/image links/media files” or an “location template” will include shortcode/textfields for Google map API etc etc.
While I’m a front end developer- I do welcome perhaps working with you if that means getting this site up and running sooner. Thank You!
If you want to integrate shortcodes form a plugin, how would that work with this customized page methodology?
@Dave
Not sure what you are asking for related to using short codes, plugins and customized pages. Could you give me a bit more detail of what you are trying to do?
Thanks for this tutorial!!!   Very helpful in making a site look great!~
Anonymous
Sweet!  Thanks for making what was seemingly (after perusing the forums) difficult quite straightforward.  Much appreciated!  
Thanks, just what I needed to know.
Paul,
Glad that you figured it out.
Thanks,
Bert
Paul Chamberlain
Ugh – I just figured my problem out – I needed a posts_per_page=-1 in there. That one always gets me!
Thanks anyway!
-Paul
anne pouch
Great tutorial but when you use custom templates it no longer is possible for most users you maybe building a site for to update the site themselves without teaching them HTML/CSS , ftp, custom_fucntions.php, etc.  correct?   How do you handle this with content you want clients to be able to update easily?
Berchman
Hi Anne,
Typically when I build any fully custom solution I will do a video tutorial that I provide with the project. That way you can watch me publish/edit/delete using the tools within WordPress and your custom template.
Let me know if you have any questions.
Thanks,Bert
Thanks for such a detailed tutorial..
Defalcator
this is simply awesome,love your tutorials about customizing of the thesis framework
It’s my bad I haven’t come on this site before.  Only when I’m having problems with my blog I’m coming to sites like this.
Harish
you saved me hours of research work. Thanks so much 🙂
Joshua
Hey, great post! I’ve already created a bunch of page templates. I also created custom sidebars for each page, so I’m not using the thesis build sidebars function. However, I don’t get my multimedia box above the sidebar, how would I go about doing that? I tried looking briefly for the function to build the multimedia box, but decided I would just ask you.
Thanks!
Joshua
Dan
This is a great tutorial, and I did manage to create a custom home page with this, but I’m having one little problem.
The custom home page I created as two equally-wide columns. I created and added the two styles to custom.css, then added the custom home page template to custom_functions.php. The two columns appear nicely, but the footer doesn’t want to clear both columns. Instead, it seems fixed about about 520 pixels below the header.
Any idea as to what I’m doing wrong?
Thanks, Dan
Anonymous
yes this is really very helpful.
Hey Berchman,
Thanks for the great post! This is what I was looking for. Just a quick question, will the custom template let me handle everything ? I mean, can I hide the default thesis stuff like sidebars, content box, footer ? I have complete code with me for the home page layout which I would like to use for home page instead of the default thesis layout. Is this possible ?
Oh and one last thing! A quicker message for “recycling” or using these custom page templates throughout your site is to not assign them as a custom page template. Let’s say on your home page you want to display a featured area, but the rest to stay the same, and you want to add a featured area to 13 different pages – but with the lower content staying the same, simply write out your featured area, test for the page, and insert it using hooks to the appropriate location. Hopefully this will help people move from rinse, wash, repeat, to simply rinse and repeat 😉 Happy coding!
Stevek1921
This is a great post! Maybe because it’s really late, or because I’m not good at code… probably the later…;o) In any event, I followed the tutorial and attempted to paste my HTML into the section that says, ‘…..Your custom layout goes here…’
And now my home page (which I want to create as a squeeze page) says, ‘..Your custom layout goes here…’.
I even tried to add some Custom.css but I’m sure that is wrong as well. Any help would be appreciated. Thanks!
Steve
Stevek1921
Ironically my page now loaded…. So.. thanks again for the great tutorial! I just need to do some tweaking on formatting and fonts, but I think I can manage. Sorry for the confusion.
this is a great article i love reading the content on this site
Adam
I have been working with your code, and the custom home page works like a charm. For some reason, I cannot get the second custom template to work, the pages will appear without the default template, but none of the html for the custom template shows up. I think I am referring to the page incorrectly, can you provide more details on the if (is_page(‘ ‘) portion of that process? Thanks.
wow…this is interesting tutorial…very helpful for me..
Dean
I’m really struggling here…
I want to create 15 pages in Thesis for my reviews. As all my reviews are done in HTML/CSS I just need a blank page template from Thesis.
How would I create this blank template, I followed another guide to do this for my homepage…
Could I use this same blank template for all 15 of my review pages?
I’m totally confused 🙂
To be frank I am not coder and these steps goes nowhere for me… 🙁
how much a coder will charge for customization?
pls email me
Anonymous
First of all, a huge thanks for making this topic clear. I’ve been stuck for a while and after reading your post, I at least got started. However, I’m still facing some issues and I’d greatly appreciate if you could please give me some more pointers as I’m still very new to Thesis.
We’re a non-profit with most volunteers not very tech savvy. So what I’m trying to do is use the blog to populate rest of the website. For example, if someone posts a blog under video category, I want that post to pop up on the Videos page.
I followed your example and wrote this:
/* CUSTOM Videos TEMPLATE */
function videos_template() {
if (is_page(‘videos’) || is_page(’11’)) { ?>
Videos
<a href="” rel=”bookmark” title=”Permanent Link to “>
<?php } }
add_action('thesis_hook_after_content', 'new_videospage');
Thanks again for a great post and I hope I can implement it correctly.
Hi Mike,
Are you certain that in the ‘settings/reading’ page in the admin area that you have the ‘static’ radio button selected and then select the appropriate page from the pulldown menu? This coupled with selecting ‘custom template’ when viewing the page in the ‘edit’ mode should do the trick.
Let me know if you have any questions.
Hope this helps.
Hi Berchman,
I like your tutorial, but in a way it doesnt work.
I followed your steps, but somethings seems to go wrong, i mean there is nothing changed on the page i chose for being the custom template. Maybe it’s in the code? Do i only have to copy your code or should i change something? like this: if (is_home() || is_front_page()).
Sorry for being a noob.
Sherwin
Please forgive me if i don’t make sense. I would like to have every page in my blog with a different design (not more than 100 pages). Do i have to use Custom Pages for each page. If Yes, will the custom_functions.php page get too long for my blog to work because i see that i have to add each custom page code to the custom_functions.php page. Please help me understand.
Sherwin, In theory you have it correct. It really depends on how different each design is. If they are all completely different (quite an undertaking!) then yes you would need custom code for each page. However, if many/most of the pages would share common elements, ie. a certain sidebar will show on pages 1, 5, 27, 45, etc. then you could write functions for each of those page elements and create cascading if-then-else statements to ‘mash-up’ your pages as you need them to appear. Each distinct page element would need its own function. Let me know if you have any questions. Hope this helps.
Kaz, are you trying this with all pages of the site? Or a specific one? If so, can you give me the exact URL?
==
robyn, yes. you have to apply the template using the sidebar pulldown in the page editor AND specify the page in the custom_function.php conditional.
==
aaron, yes you have it correct and what you explained is what robyn is asking.
==
marek, you are welcome.
Marek
Man, you just saved my life.
aaron
i think i just figured it out…. you select custom, and then based on your function (if page is _____) it will use that code.
aaron
I have had no need to modify the home page, but have needed an extra template (client needs to show two authors content on the same page and styled differently). So, I created this:
function another_page() {
if (is_page(‘another’) || is_page(‘134343’)) { ?>
stuff goes here
<?php } }
remove_action('thesis_hook_custom_template','thesis_custom_template_sample');
add_action('thesis_hook_custom_template', 'another_page');
I do not get an error, but the "template" doesn't show up as an option when I go to create the page.
How do I get it to show up? thanks
robyn
So berchman, if I only want to change subsequent pages, can I leave the front page as is (not create a custom template) and only create custom templates for pages I want to adjust sidebars in?
Hi – I’ve persevered with this (as well as the sidebars tute). I put this in custom functions:
function home_pagecustom() {
if (is_home() || is_front_page()) { ?>
<?php the_title('’, ”); ?>
Not Found
Sorry, but you are looking for something that isn’t here.
<?php } }
remove_action('thesis_hook_custom_template', 'thesis_custom_template_sample');
add_action('thesis_hook_custom_template', 'home_pagecustom');
and it did something but looked odd!
So I put this in custom css:
home_pagecustom{width:820px;}
And realise that probably not the right call but I tried most other things; still did not look right.
I seem to be getting these templates to call up; but I just can't get the sitting right! Can anyone tell me what on earth I am doing wrong both with this and my sidebar template. Is it the way I am custom css-ing it.
Yours patiently and back to the standard sidebars for now!
Is there a way to have it register the custom templates inside WordPress instead of basing it off the page id? That way, the user could just pick it on the sidebar while authoring the content.
Hi Melvin, You are wanting the custom templates you create to show in the sidebar pulldown. To the best of my knowledge within the Thesis framework that is not possible. I have nto read or heard of someone being able to do that. However, if given enough time to work on it I imagine anything is possible. I would post this question to the Thesis forums to the larger Thesis audience.
Alex
This tutorial is great, but I am still having issues.
I want my header, footer, and sidebar to remain the same, but I am placing content within the content div. It displays only the header and the new content, but not the sidebars.
Alex, do you have a link you can email me so I can take a look? It sounds like a div nesting issue.
Your coding started with div id=”content” . How do I ensure that the standard header and footer will remain intact and that I’m just replacing the middle area (regardless of how many sidebars I have)?
I want the header and footer but, three static columns for the middle that I’ll add javascript to.
Your tutorial kicks some ass, man.
Hi Shane,
As long as you are using standard Thesis templates the code in that tutorial only replaces the center content. The header and footer show as they should on all other pages/posts. Let me know if you have any questions.
Andrew
Nice tutorial. I’m wondering, is it possible to put some custom php inside these hooks? What I’m trying to do is insert a shopping cart (which calls to a separate MySQL database) inside a specific Thesis WP page. I’ve done this in other standard WordPress templates, but having a hard time inside Thesis. Any advice?
Hi Andrew, You can put custom php inside the hooks. It just a matter of tweaking until things work as you want. You may also want to checkout Open Hook. It may help as well: http://rickbeckman.org/thesis-openhook/
BTW, I wrote a simplifed version on how to create custom sidebars to go with your custom pages over at the official support forum: http://diythemes.com/forums/support/6039-sidebar-content-different-each-page.html
Hi Marcus, Thanks for the comments. BTW you might check out my custom sidebar tutorial as well. Let me know if you have any questions.
Thank you! I have been doing some modifications on Thesis and your little guide here rocks Mr!
Thanks / Marcus
Hi, Thanks for this tutorial. Im still a little unclear. On my site I basically want the home page to be 2 columns and all the rest of my site (which are just different categories for my blog) to be 3 column as they are now.
I want to put the FCG on the home page only, in one of the columns and the other column would have the most current blog post. I want the nav bar to be the same on all pages/posts.
Ive created a page called “home”, and set it at “custom template” and called it “static home page” and put the code in “customs_functions.” But not sure what I do now. Do I have to do the styling by code or can’t I go in and set up the columns for this home page in “thesis design options.” Am I making any sense here? Thank you for any help. I am a beginner but Ive accomplished alot (in my mind) so far in my newbie state : )
Hi Allison,
You are definitely on the right track. The key is inside custom_functions.php. The function you write to replace the home page has to be called by the proper “hooks.” If your homepage looks like the rest of the site, and you have double checked that you have it set for ‘custom template’ in the pulldown, then I suspect the culprit is how you are using Thesis hooks to call the function and replace the homepage template. If the hooks were working your homepage would look different than the other pages, even if your home page template was not 100% accurate. The hooks would replace it anyway.
Take a look at the references about hooks and how you have them implemented. Then let me know if you have any questions. Hope this helps.
Great article. Allowed me to get some of the home page lookin just as I wanted. But now I’m stuck again. I’ve inserted my own static code on the home page now I want excepts of my posts to be listed – I’ve tried putting all the loop commands in my copy of your code and I only get a blank copy of my Home page – with lovely sidebars, header etc. Please point me in the right direction to get the piece I’m missing. I checked the forums to see if anyone else had posted but I didn’t see anything so I’m back to ask you – since I’m sure you know. Thanks a lot
Hi Jennifer,
If what you want is to list just the excerpts of your posts you should refer to excerpt basics here: http://bit.ly/19mirP
If you email me your custom_functions file I could take a look.
I’ve read and re-read this article, as well as your more recent post on custom sidebars. I still have a couple of questions I hope you can help me with:
1. I have a three column layout, with sidebars on either side of the content. For some pages, I’d like to get rid of the left sidebar and enlarge the content area. What’s the best way to accomplish this?
2. I use conditionals on my custom_function file to create content sensitive sidebars. It’s not pretty, but it gets the job done. For pages, would the better way be to use the custom template, or does it not really matter?
Thanks.
Hi Dough Roller,
For #1 if it is indeed for ‘some’ pages then I would create a custom page template and build the template layout to have only one sidebar. I would also “ID” the content area as ‘content-wide’ and then use css to style appropriately.
For #2 it depends. Many times there are multiple ways to ‘skin it’ so its just a matter of efficiency. If what you have going works for your purposes then ‘if it ain’t broke, don’t fix it.”
Hope this helps.
Lovely, now I’ll just get my smart hat on and reread Rae’s ‘hooks’ “clarification’ and try not to hurt anyone in the meantime. HOWEVER — if anyone can point me to who can do this for me for $, I’m all ears. Thanks ~ !
Nicky
Yo Berchman, I’m eagerly waiting for your tutorial to have different sidebars on different pages.
Regards,
Nicky
George and Nicky,
Was having issues with my own Thesis install and had to work those out.
I should have the new sidebar tutorial up soon. Stay tuned.
George
Hey berchman,
Thanks for the great stuff. On a May 9th comment (above) you said something about a tutorial you were making on creating pages with their own custom sidebars.
Have you got that done yet or can you direct me to a source where I can learn about how to have different sidebars on different pages in Thesis?
Thanks.
Hi again,
I followed all your instructions and can get it to pull the custom template (which is just a grey box for now). The problem is that the custom template doesn’t pull the content that I have written through the dashboard. It’s only pulling the content that I put in the custom_functions_php file. I don’t know php so I’m a bit blind here. My intention is to be able to add all content through the dashboard and have one sidebar (sidebar 1) on the right. Any help is SO appreciated. Thanks!
Hi Mary,
You most likely need to run the WordPress “loop” and pull the content you want in that way. You can read more about the loop here:
http://codex.wordpress.org/The_Loop
Here is an example I use to pull the content for a homepage. You must have the page ID’d as the home page in Settings/Reading
function home_pagecustom() {
if (is_home() || is_front_page()) {
?>
Not Found
Sorry, but you are looking for something that isn't here.
Let me know if you have any questions.
Hope this helps.
This was very helpful. I’ve been wanting a custom Thesis homepage for awhile now and just never took the time to learn how. I am testing this on my local machine and it works like a charm. Appreciate it. 🙂
Thanks for the kudos Lisa. I checked out your website. Quite cool. I like how you are keeping it real for people. Great topics, great content. Cheers!
Mary Baker
I am using Thesis 15 and want to have custom templates for some of my pages. How can I add content within the dashboard with a page that is using a custom template?
Hi Mary,
You first need to create a new page and add its content. While viewing the page you make sure you have “Custom Template” selected from the right side pulldown menu (look at the tutorial above, it is spelled out). Once you have that done you need to go through the coding process I have outlined above ( in custom_functions.php ). This way the page is looking for its custom template and it is applied appropriately. Hope this helps.
Nicky
That sounds really good Berchman, I’ll be looking forward to it. So far, I’ve managed to add the sidebars but I’m not able to get the layout of s3-content-s4.
Thanks,
Nicky
Nicky
Hey Berchman,
Thanks for the tutorial. This is somewhat related to what I’m trying to do.
I have a query. I want to show two sidebars (3, and 4) different than the ones displayed on homepage and rest of blog. How do I go about it? I want the layout to be s3-content-s4.
Any help on this would be great!
Thanks
Hi Nicky,
Thanks. I should have the sidebar tutorial online by end-of-day Monday (hopefully sooner if possible). Stay tuned.
Cheers,
berchman
Great tutorial. I’m a relative newbie and got it working on my test site using your example. However, my goal is to create a custom template that uses a different header image than the rest of the site. The navigation tabs would stay the same; I pretty much just want to be able to specify a certain header image for certain pages. Your tutorial seems to just include the stuff under the header and before the footer. Any advice on how to proceed?
Thanks!
Hi Jason,
Thanks for the compliment. As is the case in many things WordPress there is more than one way to tackle what you want to do with your headers. However, since we are working within Thesis I think the best thing to do is to build a subroutine that tests for pages/posts/categories and then inserts the correct header. Then you could run that subroutine in the standard Thesis template using hooks, or if you have custom page templates you could reference the ‘custom_header_subroutine’ within it.
BTW, checked out your website. So cool! I needed a reminder about escaping adulthood. Is that the website you are looking to use Thesis with?
Let me know if you have any questions.
Hi there,
This is somewhat what I have been looking for Thanks.
I’m new to blogs all together and starting a new RE site.
see link- http://www.carealproperties.com/
I would like to set sub pagers to my site a little different than my home page and my two question’s are as follows:
1) As you can see my areas of service are in the left sidebar and those links take a user to a static city page that also has the left & right sidebar. (I would like to keep the left sidebar on all pagers.) On the sub pagers only I would like to change the right sidebar to break up the cities into neighborhoods.
2) On the sub pagers I would like to have a static introductory section at the top of each of the cities and neighborhood pagers that will not get lost in the archives. In other words I would like any posts to be below the static Introductory.
I don’t even know if it is possible and I would greatly appreciate advice. “)
Hi CARP,
Yes, you most certainly can do what you are after. In fact I am in the process of finishing up a tutorial on multiple-sidebar-options. In the default WordPress/Thesis environment you only have 2 sidebar options. My tutorial will show you how to create as MANY sidebars as you want/need and how to use it in combination with the principles in this tutorial to get exactly what you are after. I should have this tutorial published within the next week.
Hope this helps.
Hi Paul,
Thanks for the link to the plugin.
Thinking about this ID issue I realized I may not have been specific enough. By default you should see it in the bar at the bottom of your browser, not necessarily on the ‘tool tip’ hover. If you have changed your permalink structure in the admin tools of WordPress then this would not work either (as is the case on this website) and the plugin would be the way to go.
Let me know if you have any questions.
Paul B
Nevermind… I found out why! As of wp2.5 the ID is not shown anymore.
Here is a plugin to display it though, and it works well for me.
Paul B
When I try tofind a page ID by hovering…over the link to edit the page when viewing a page list within the admin area of WordPress., it does not show the page ID. It only shows the name (title) of the page.
Question 1, Is there something that has changed in WP 2.7 or Thesis 1.5 that behaves differently than when you wrote this tutorial?
Question 2, Is there an alternate way of finding a page’s ID? Besides opening up the DB and finding it there, of course(~:
Hi Julie,
Yes, you do get the source code from other files that are setup how you like combined with the customizations that you want.
You also need to identify the page you want to have this custom template applied to and develop the right logic so it happens how you want it to.
You asked where to find source code that is being used for the pages. You can find it in here. NOTE: Don’t edit files inside this directory or you are playing with fire. 🙂
You may open the files in this directory to copy/paste elements into your custom_functions.php to play around and get what you are after.
Hope this helps.
Thanks for this awesome tutorial, and for the link to the Sugarrae article on hooks. Despite the excellent advice, I still don’t have my custom templates working the way I want.
I have a simple home page, which I’ve already set up. I want subsequent pages to be very similar – same navigation, smaller banner across the top, fewer sidebar elements.
I’ve got the custom_functions.php file downloaded, but I’m not sure what to enter for the custom content. I don’t want to do the html – I want to duplicate *most* of what’s on the other pages. Where do I get the code? Do I copy it from the various templates in the WordPress editor?
Can’t help but think I’m missing something obvious here…
Actually, Alex explained my frustrations much better, and in your response to Alex you suggestions the following:
You can try this link for CSS help: http://www.w3schools.com/css/
And for PHP this may help:
http://www.w3schools.com/php/
I believe this is what I referred to as “point A” for which I will be spending some quality time.
Thanks!
Hi Alex,
I would setup your homepage using the Thesis settings under the Appearance tab when you are logged in as the Administrator. Get your sidebars, etc. to show how you want using the default toolset.
Then for your categories and pages I would use the tutorial above to setup your page layout templates how you like. As far as learning PHP and CSS… for me it has been years of self-taught trial and error.
My education included programming, but it was FORTRAN, COBOL, PASCAL, and some Machine Language for good measure. I learned principles of programming from taking those classes which help me now, but aside from that its hack and see what sticks.
You can try this link for CSS help: http://www.w3schools.com/css/
And for PHP this may help:
http://www.w3schools.com/php/
Hope this helps.
Hi there, thanks for the post – this is just what I’m looking for but I have no idea what language you’re speaking. Wondering if you can shed some more light on this. I get the feeling I need a “Dummies Guide” to php and css before I throw my laptop out the window.
I need to use the Thesis home page with a 3 column layout (sidebar1, content, sidebar2) and the teasers option. But when a user jumps to a category and a page have a typical blog page (content, sidebar1 (maybe sidebar2 as well)).
I’d like to learn this on my own, can you point me to where I should start reading. I honest think I need a primer. I’ve tried following through the Thesis forum and am lost on most things, the coding is frustrating me.
Suggestions.
Thanks Alex.
Hi MirzaLou,
If what you want is a tutorial on customizing the navigation with drop downs the best tutorial is at Kristarella’s website.
As to your question on where to begin with your customization I think it depends on what your goals are. What things do you want to change?
If you look at the entire scope of changes it may cause you to feel overwhelmed. However, if you tackle each item singularly you will customize your site and learn piece, by piece.
So I would suggest figuring out what you specifically want to do, break it down into specific tasks, then figure out how to complete each of those tasks. It will, no doubt, involve a bit of html, php, and css depending on what you are after.
Let me know if you have any questions.
Hope this helps.
Hi Gregory,
Yes. You would not find any reference on the Thesis website to that function. It’s buried in another part of the theme. I have been on Twitter with Chris Pearson, the Thesis developer, and he was gracious in answering my questions. He directed me to the location of that function.
It is here: ~/themes/thesis/lib/html/sidebars.php
NOTE: If you modify any files outside of the /custom/ directory then you run the risk of not being able to seamlessly update Thesis.
Hope this helps.
I’m new to Thesis and I’m trying to understand all of this. I guess I should ask this in their forum but I like your site so much I wanted to ask you. 🙂
Which tutorial should a beginner start with before trying to understand what you are explaining to do here with custom css and such? If that makes sense? I’ve looked but not sure where the beginning is.
Because Thesis claims less coding, don’t have to be a programmer etc., yet I still just don’t get it.
But I’m having a ball trying to learn! Just not sure how to get to point B since I haven’t been to point A.
For example, I’d like to create drop down menus for my navigational bar across the top or in the sidebar(s).
Thanks!
Hola,
Thank you for the post!
Question: I see you used a function thesis_build_sidebars() but I can’t find any documentation on this on the Thesis site.
hi lawton,
thanks!
you can certainly place only the content from your specific page. I would follow the “press page” example above and then only put the_content() into the page.
Let me know if you have more questions.
Mario and Lisa,
Yes. You will find that the home link will take you back to the root level, in this case index.html instead of index.php.
You will need to create custom navigation to override the home link and change it to index.php. Here is an example:
remove_action('thesis_hook_before_header', 'thesis_nav_menu');
function add_custom_nav () { ?>
[ Put your custom navigation in here ]
<?php }
add_action('thesis_hook_before_header', 'add_custom_nav');
This will remove the standard nav and replace it with your own, custom defined version.
Hope this helps.
Thanks for the hard work! Is there anyway to strip all of the no sidebar options so it’s just a squeeze page, no, comments or footer?
That works – but yes, the home link goes back to the splash page. I’ll have to link it as you described.
Same here. I’d only like to replace the HTML content in the content area. My concept is to use this as my homepage:
http://www.kingoftheocean.com/index2.html
If we can do that by defining the necessary html in the custom_functions.php and custom.css files, it gives us an easy framework. The question is what hooks to use, and actions to add/remove.
Hi Jen,
You *should* be able to upload your index.html file to the root level via FTP and it will supersede the index.php file from WordPress. WordPress has behaved that way for me in the past. Just ensure you link from your index.html file to http://www.yoursite.com/index.php
Once caveat, the home link inside of WordPress may take users to http://www.yoursite.com and thus they will see the the splash page again. Just be aware of that. You could hard-code the link inside of custom_functions.php.
Hope this helps.
I’m looking to have essentially an HTML splash page that then links to a thesis site.
Hi Mario and Lisa,
To the best of my knowledge you should be able to do that without having to create a separate directory.
The only clarification I need to help me understand what you are asking is when you say:
“I’m looking to create a custom homepage using my own html, and none of Thesis body content.”
Do you mean you want to use no html generated from Thesis AND WordPress?
Or do you mean only the HTML content generated in the content area? (header, sidebar, footer all generated by Thesis/WordPress?)
Hi Amit,
I believe you could use the ‘is_category’ or the ‘in_category’ conditional tags to test and then implement the code you would like. For example:
function new_categorypage() {
if (is_category('5')) { ?>......
In the code above you would substitute your category ID where the number “5” is.
You can find the syntax for category testing here:
http://codex.wordpress.org/Conditional_Tags#A_Category_Page
Let me know if you have any questions.
Hope this helps.
I’ve got the same question as Mario. Thanks
I like this process; really helpful for custom pages I will be creating. However, I’m looking to create a custom homepage using my own html, and none of Thesis body content.
Is this possible by removing actions from various hooks, and adding my custom template as described using the (thesis_hook_before_html)?
Or is it preferred to create a server subdirectory instead for all WordPress pages, and manually link to them from the home.
Just trying to save some code time, without having to copy/paste meta information with future updates.
It is very helpful. Thanks…
How can be category pages customized in the same manner? I need to order post based on custom fields. I have done it on homepage using your tutorial but need to do it on category pages as well?
hi doug,
Once you indicate a custom template and follow the instructions above, you will need to code each different layout, or *look* that you would like and use the right logic to get them to show up on the proper pages.
Hope this helps.
doug
ok, one more question: do I need to copy/paste the entire code from Thesis for each custom page, or does every custom page template already include my current look?
Hi doug,
Yes you do need to create a “home” page and then select it from the drop down menu. What you are seeing now is the default WordPress behavior. Let me know if you have any questions.
Hope this helps.
doug
Ok, but one question. My Reading drop down list doesn’t list “Home” as one of the options as you showed after “Gettin to it” above. Yet, my site definitely has a “Home” link on the nav bar. Should I create a page called “Home”? to use your code above?
The confusing this is that right now, my blog posts all show up on the page called Home, but I never created a page called Home. I guess that is a WP default or something?
rumblepup,
Thanks for the compliment. I think I may do a tut on extra sidebars. You are the second person I have come across who would like to do that. Are you wanting a 3rd sidebar? What kind of sidebar configuration are you after?
Great tutorial. Hooks drive me crazy. What I’ve been trying to do is create additional sidebars, but haven’t had luck so far.
Hi Jen,
Based on what you are describing and the link you sent above I think you can do what you want. You can certainly create a page template and apply it to any specific pages you like.
So it is entirely possible to apply a template to just one page, or to every page but a specific one. You just need to structure your logic correctly.
If you can be more specific I can try to help.
Jen
opps! I probably should have sent the link along! jen11show . com
Jen
This is such a great tutorial! I’ve been playing around with Thesis for a while now and it’s been quite a ride. I just finished my first site using it and looks like your tutorial would have helped immensely – especially since I’m a total novice.
So heres my question (forgive my ignorance!): The first page on the site is a grid system of images which are links to each artists page. I used ‘stack’ to align the images but just found tables yesterday and it seems that might have been the better option? Could I create a table, use the code for a page template, and then use that for the home page thereby keeping the ability to change out images easily?
Thanks again for sharing your work!
best,
Jen
No problem Kathy. I struggled with this code for a while and thought that it might save a few people many hours of frustration. Glad it helps. Let me know if you have any questions.
Great tutorial, timely for me as I am combining my current website with my blog and this helps me no end in how to start to reconfigure things. Thanks again for posting this
Rebecca
Thanks for this tutorial and all the helpful information on this site. Question: Can I create a custom page template for my About page without first setting my home page to a static page? I want to keep the home page dynamic (dynamic listing of latest posts in #content with two sidebars of widgets and custom ads). I'm trying to create an About page that has only the content added from the Pages panel and has a single sidebar with unique content (client quotes, etc.). I've been trying to do this following your instructions above, but so far, it's not working. Thought before I fiddle around further, I should check to see if it's because I don't have a static homepage.
msc
“You asked where to find source code that is being used for the pages. You can find it in here.”
Was there a hyperlink to a directory in this sentence?
Is there a way for me to remove the header and nav menu from a custom page template? I imagine I would do that with a “remove” hook, but I'm not sure where to put it in the function. Thanks!
Dev
Never mind, figured it out! Again, thanks a lot for this post. It helped a lot!
Dev
Thanks a lot! This helps a ton!
I am trying to take this a step further. There's some code I want to keep static through all pages (styling) So I am including it in the custom_functions.php file. But at the same time I'd like that the actual text content for the page is populated from my WP pages. Is there any special WP keyword I should add for this?
Thanks again!
Great tutorial here buddy – thanks for putting it together!
QuantumGood
Any thoughts on whether this would apply to Genesis (StudioPress) generally?
jvgreene2
This is a great post and has helped me tremendously. What I really want to do now is to add another permanent template that I can choose from the drop-down with the other options (Default Template, Archives, No Sidebars, etc.) that looks a little different and maybe has a different header that I can choose on a page by page basis without specifying each page id in the custom_functions.php. Is that possible?
Thanks
I would also like to add a template choice in the template dropdown, like jvgreene2 said. Can that be done? I’m trying to make choosing templates easy for non-technical users of my site.
do you by any chance have a tutorial on how to create a category page that shows an excerpt of each post(including a picture)
Manu
I undestood a little bit but not everything.
All I need is an image that shows up when you go to the website, and click on it to enter the main blog…Is that possible? Many thanks
I have the custom template option for pages but they are not there for posts any advice will be much appreciated
I can't seem to find the custom template option for posts in wp 3.0 thesis 1.7
Is there something I am missing ?
oopps just saw berchman has answered this already
HI,
I am also looking to use custom templates on posts. Were you able to find a way to get this done ?
Cheers,
Vishal
You have very clearly mentioned this is for pages but all my content is for posts and I wanted to double check if I can use this with posts too before I dive in for good
I'd like to create a template that affects every page that is a child of a specific page. Is this possible without having to call every single page in the conditional statement. This is what I've tried, but it doesn't work:
if ( is_page('9832') || is_page('9830') || $post->post_parent == '9830') {
What am I missing?
Thanks!
I'd like to create a template that affects every page that is a child of a specific page. Is this possible without having to call every single page in the conditional statement? This is what I've tried, but it doesn't work:
if ( is_page('9832') || is_page('9830') || $post->post_parent == '9830') {
What am I missing?
Thanks!
Hi, I visited your site and it appears that the video page will not load at all. Can you tell me what you have done?
Jan
I've read you post and the comments several times. I don't understand php at all. What I'd like to do is create a custom template that's simply a blank page – no header, no navbar, no sidebars, no footers. Just blank pages to run videos from. Possibly a Title on each. Is this possible? If so, how do I code the custom_functions.php files to remove all the stuff I don't want?
Jan
I've read you post and the comments several times. I don't understand php at all. What I'd like to do is create a custom template that's simply a blank page – no header, no navbar, no sidebars, no footers. Just blank pages to run videos from. Possibly a Title on each. Is this possible? If so, how do I code the custom_functions.php files to remove all the stuff I don't want?
Awesome summary. Many thanks for sharing. I've been using Thesis for 7 months or so, but just now really getting into some higher level mods… This is great
Mike
Hi, thanks for the tutorial. There's a couple things I'd love to know.
1) Can you still use the SEO options Thesis gives you for pages with these custom templates?
2) What's the difference between this way of creating custom templates and the one at gregrickaby.com?
a) do one of these ways work better with a higher # of custom templates (like say 5+)
Thanks!
Great Tips. But I wanna use a fully separate static page. Is it possible
Mikkel
Hi Lisa, you can just configure thesis to not show a 'home' link, and then add a custom link of your own to the menu, call it 'Home' or whatever, and link it to index.php
this can all be done using the thesis admin panels with no custom coding required.
Amanda
Hello! I'm trying your technique of setting up a custom page template, and I'm stuck on something.
Would you be able to explain the basic methodology for removing or changing something that's already on the page?
For example, I have a custom nav bar (made of images) that I have placed below my header using the “after_thesis_header” hook. For my custom homepage, I want to add an additional image between the header and my nav bar images.
I think I'm missing something obvious, but I'm not sure how I would do this. I don't understand how we can alter existing design elements to get them to look different/be arranged differently in a custom template.
Any help would be much appreciated!
Brigitte
I'm about to start a new website and I'm wondering if I should give Thesis a go. I have always designed my sites in Dreamweaver and done all the SEO I can do.
If I try Thesis, am I going to simplify my life or complicate it by learning a new system from scratch that won't do more than what I can already do?
Any feedback would be appreciated. Thanks.
zbychxxx
thanks for the great info. However i would love to see second part of this tutorial. Like someone else asked above: how would you bring in content that has been entered in the page editor. the_content() seems like only for coders suggestion 🙂
what if i want to create a custom template that still works with functionality of WP. So i could still use page editor, widgets and all that without editing custom_functions file. Is there a way to know what's my current Thesis template is in terms of php template code structure so i could use it in “…Your custom layout goes here…”??
thanks!
You need to base it on the post ID. FInd the post ID number and use that in the conditional.
You would need to pull in “the_content()” from the correct page or post.
Karley
Great tutorial. I didn't realize you needed to create separate functions for the other pages. Instead of hard coded the content how would you bring in content that has been entered in the page editor.
i follow your great tutorial and i get it works on some of my page. but can we do the same thing on single post page? i tried various ways but not yet figure out how to define a custom template for single post.
any advice?
Thesis Junkie
How do I use a custom page template for the blog page (it is a static page)? It always defaults the standard page layout? Thanks.
I have been able to create custom templates for all other pages.
Graeme Mac
For the home page only I'd like to remove my category navigation.
I am trying to use:
function home_pagecustom() {
/* check to see if homepage. has to happen inside the function */
if (is_home() || is_front_page()) {
?>
<?php remove_action('thesis_hook_before_content_area', 'category_area'); // Input Category Area ?>
// Custom HTML Here //
But it's still pulling it from the loop before this code executes.
Any help would be appreciate.
mel
I've used your tutorial to create a custom home page that uses a jpg containing the logo. The image does not appear when I view the page. What path should I be using in <img src … to bring in the image?
ireey
You have great tutorial and I am glad to paid a visit here. Can you please help me on my problem? I am currently designing a website using Thesis, is it possible to make a certain page (Blog) stand out in the nav menu in bigger letters? Also, is there a way to upload the image without using the URL? I want to know how? Thanks in advance!
Hi,
Thanks for your useful tutorial. I am trying to make the home page a magazine style layout which I can click to pages in behind. I did try to make the home page a static page but it seems like the sidebar widgets are all gone and I have to code the home page in html. Is there a better way to do this?
Marco I would take these two things separately. I would create a function to test and deliver the proper header area, then in the custom page template I would call the function to deliver the right header. It's nested functions. Hope this helps.
Lyman you are very welcome. Glad it helped you out.
Thanks Travis. If I understand you correctly you want posts to use a certain custom page template. You should be able to create a conditional that tests for the correct category ID and then deliver the proper template.
You make the conditional check for the homepage only, then deliver your custom page template. Then in the WordPress/Thesis options you set your default pages to take on the sidebars how you like. Hope this helps.
You need to create an empty page in WordPress with the title of 'Blog' then publish it. Go back to 'Reading' and you should be able to select 'Blog' from the dropdown menu.
marcoryan
If you wanted to have the template identical on 2 pages except say for a slideshow in the header which appeared only on the home page, and then a single image that appeared on the other pages, how would you code the Else statement – something like this?
function custom_header() {
if (is_home() || is_front_page()) {
?>
HOmepage HTML here
<?php }
else {
?> Alterntave HTML code here
<?php }
}
…Your Custom homepage layout goes here…
<?php } }
Just wanted to drop you a big thank you for this tutorial. I just picked up Thesis a few days ago, and this really helped me to understand some things that I wasn't getting. So… thanks!
jona_than
Thanks for your help. This is a very helpful tutorial for me
Are your saying, how can you make a template for thesis that will post, posts under a certain category in a page by using a page template? Because I have been trying to figure that out for a couple days now so I can put it on my blog. I can let you know when I do unless someone else knows how.
travisreed
How do you link blog posts to template so when you post a blogs from control panel/admin it posts onto the custom template? Sweet tutorial by the way.. =)
Caesar
So in the place where “your content goes here” where do you find the other thesis html content to place in that place. For instance I have created a home page with thesis that has its default setting 3 column layout. I set that for my static home page. Now I want the thesis default setting 2 column layout for every other page. But where do i find the actual html to copy and paste into the custom_functions.php so that the 2 column layout shows up?
jek123
This tutorial very very helpful to me! ?learly not all, and accumulated a lot of questions for you…Required ask how they articulate.
Question(s) from a very tired mind at midnight – after reading, trying and re-reading this tutorial – and searching DIY forums multiple times.
I want a non-static home page with three columns – and that's what I have. I would like to make all other pages 2 columns (main and sidebar_2). I am good with the existing sidebar_2 content.
Can you please point me in the right direction?
The site is at http://www.PartnersForHousing.com
Thank you!
you saved me hours of trying to figure this out. thanks for posting Bert!
you saved me hours of trying to figure this out. thanks for posting Bert!
Thanks for your help. I will read up on The Loop…!
angintx
I created a home page but do not see “Blog” as an option on Posts page. What am I doing wrong?
I'm making an attempt at creating some custom pages for a new site I'm setting up. At the moment it kind of makes my head spin, but I'm hoping I can get it figured out.
Do you know a site where I'd be able to see what might commonly appear in the space where you have “…Your custom layout goes here…
“?
I'm unclear on where I would find the elements to drop in that area, what they'd be called, etc.
Sorry if this is a dumb question, I just seem to be missing that part! Thanks for any help!!
Hi Gordon,
You need to insert some php to pull content however you like.
Depending on what you want in that space it could be all blog posts, posts from a specific category, or content from a specific page. All these examples would use slightly different php. A good place to help understand what is going on is to read up on the “WordPress Loop”: http://codex.wordpress.org/The_Loop
Hope this helps.
Gordon
Possibly a really lame Q, but how do I actually call the text from my Page? In your example you have the following code;
?>
…Your custom layout goes here…
<?php } }
How do I insert my custom layout? All that appears on my home page is '…Your custom layout goes here…'!
I have looked around and can't find the answer – probably because I don't know how to ask the question!
Thanks for your help!
Gordon
Possibly a really lame Q, but how do I actually call the text from my Page? In your example you have the following code;
?>
…Your custom layout goes here…
<?php } }
How do I insert my custom layout? All that appears on my home page is '…Your custom layout goes here…'!
I have looked around and can't find the answer – probably because I don't know how to ask the question!
Thanks for your help!
Hi Janie,
You need to click on the “Edit” button, not the “Quick Edit” button.
Hope this helps.
Janie
This is the simpliest of all questions. When I to to quick edit page, the only template I can choose is default. Where are the other options as you show above
Hi Jenny,
You would need to build a custom template to handle this based on what
type of page you are trying to display.
Your conditional would have to test to see if its listing content from
category pages, and then deliver the right custom page template.
Hope this helps.
jennybuttler
Hi there,
I would like for Thesis to display the full post upon clicking on the category instead of just the post title. How do I go about doing this?
My site is simplydelightfuldesigns.com/blog – there are a few tester categories in the sidebar right now, when you click on them, the post titles are in a list.
Dan, this is for newbs and for people new to Thesis.
You need to change reading settings and custom templates on pages because the custom page templates will not be inherited otherwise.
If you want to do some serious customization this tutorial is helpful. If you are happy with Thesis “out of the box” then this tutorial doesn't have much value for you.
Dan
This is for newbs?
Reading settings: Why change this? It already does this.
Switch to custom templates on pages: Why? It works fine.
The advice might be awesome, but it would be helpful to indicate which problems they are a solution to.
Thanks
Hi Doug,
Thanks for the kudos. In terms of “how” to create a custom layout I don't have a resource off the top of my head. However, this makes me think this is a good topic for a tutorial. Stay tuned.
This is a great tutorial. I just got Thesis myself and I'm currently tweaking it for my new design business site. I only have one question: can you link me to any places where they have tutorials on how to build the “custom” layout for these pages? I didn't have a custom home page either and I'd like it to just be like the default Thesis home page, but I haven't a clue how to do that.
Thanks again for the great tutorial. I have bookmarked your site and will be checking out your other articles.
andimac
How do you remove sidebars from a custom page? Probably a really simple question – pardon that.
Great tutorial and thank you for making it very simple and straight forward. Believe it or not I was looking for this exact info for about 5 days now and finally came across your post.
One question about the custom code … How would you display a NexGEN gallery through the custom code in the custom_functions.php page? As it appears right now I only see the 'call' to the page displayed on my page as [slideshow=12].
Any help or nudge in the right direction you could provide would be very helpful. Thanks again!
-Jeff
Giacomo, very creative solution. I am finding Thesis to be extremely flexible. You just need to think things through and you can usually find a solution. Thanks for sharing.
Hi Berchman,
Reading your tutorial and comments was really helpful to me, so I thought I'd give something back by showing how I solved a little problem with custom pages: I needed to have selected pages based on the Custom Template show no heading tags and/or no sidebars –which seemed nearly impossible to accomplish with Thesis 1.5.1, especially the latter.
Here's how I did it:
/* CUSTOM PAGE TEMPLATE */
function custom_page_template() {
if (is_page()) { ?>
<div id=”content”>
<div class=”post_box top”>
<?php if (!is_page('1')) { // No headings on page 1, please.
thesis_headline_area();
}
?>
<div class=”format_text”>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile; endif; ?>
</div>
</div>
</div>
<?php if (is_page('2')) { // No sidebars on page 2, please. ?>
<script type=”text/javascript”>
var content_box_element=document.getElementById('content_box');
content_box_element.className=”no_sidebars”;
</script>
<?php } else { ?>
<div id=”sidebars”>
<?php thesis_build_sidebars(); ?>
</div>
<?php } ?>
<?php } }
remove_action('thesis_hook_custom_template', 'thesis_custom_template_sample');
add_action('thesis_hook_custom_template', 'custom_page_template');
The first conditional PHP block will prevent Thesis from adding a headline_area <div> if the current page ID is 1, producing a page with no <h1> or <h2> tag above its content.
The two lines of JavaScript code within the last conditional block will dynamically add the “no_sidebars” CSS class to the HTML element with “content_box” ID if the current page ID is 2, making that page show no sidebars when the “Custom Template” is selected, while other pages based on the Custom Template will still have sidebars.
You can list one or more page ID's in each conditional block, of course.
Hope you and your readers find this little hack handy!
Wow that’s very outside of the box; I gotta tip my hat for originality but a simpler method would be to simply grab the div id or class and use css’s display:none 🙂
Frederik
Hi Berchman,
thanks for the great tutorial!
I tried to implement that stuff but got stuck.
What I want to do: all my pages have 2 columns: content +sidebar1.
I'd like the home page to use sidebar 2.
I tried to call the home page up with this
if (is_home() || is_front_page() || is_page('14')) {
?>
and later insert the sidebar like this:
<div id=”show-only-2″>
<?php sidebar_2(); ?>
</div>
Nothing happens on my site though. My guess is that there is something wrong with my first line of code.
I have a static page defined as front page, called Home.
This is how its called when I edith the page:
/page.php?action=edit&post=14
Any advice would be greatly appreciated!
Frederik
Brendan, the images need to be jpg, gif, or png. Tiff format will not work. Hope this helps.
Brendan
Hey,
I have thesis openhook, and m having issues. I have uploaded 10 images (tif files) in to the rotaor folder on my bluehost server, but the images are not showign up on my homepage. Any ideas what the issue may be?
Thanks
Brendan
Very interesting post. I use Thesis on my blog and am very happy with it.
I have been searching for a theme which can support different designs for category pages for my upcoming website…. or rather what you are talking about. Needless to say that I would be using Thesis… but gotta figure out if I can have the cake and eat it too 🙂
Keep up your good work.
careys
Dear Berchman,
I am new to Thesis and have my first site http://www.makesaleseasier.co.uk with Thesis 1.5.1 and own host WordPress 2.8.4. Plug-ins are Akismet, OpenHook & SimpleFlashVideo.
I am trying to remove (or make thinner) the border around the default Multimedia Box. It is a taste issue, but also a test of my learning that I am currently failing at. Please could you tell me if there is a way of controlling the MM box border through the dashboard?
I have find a tutorial on adding a border (http://www.thesishacker.com/put-a-border-around…) and have tried their code suggestion [/*border around mm box*/
.custom #custom_box {border: none; } in custom.ss] to get no border without success. Perhaps this is a syntax or code placement error on my part?
with best regards,
Carey
chinedu
how do i add a slide show to the static page similar to voteshell.com? Thanks for the tutorial, new to wordpress.
BC
Hi Berchman
Let's say my page on my site is http://www.mydomain.com/video
I would then insert something like this in the custom php function page?
function myvideopage {
if(is_video()) { ?>
<?php if (function_exists(“vimeorss”)) { vimeorss(“myfeed”, “videos”, 10, “”, “”, 760, “medium”); } ?>
}
add_action('thesis_hook_before_content','myvideopage');
I'm just not sure if I type video page url which would be the page which holds my videos such as mydomain.com/video?
Hi BC, you would need to write a PHP function to test for that specific page and then insert your custom php function into the proper place within the content div—either before or after the content—and you should get what you want.
BC
Very cool tutorial. What if you just want to keep things and add a custom phpfunction within the content div of a page so it executes your script? Where would you add the function because all I would want it is within the video page and no where else on the website. Thanks
Tim
Thanks Berchman – you have saved me hours of messing about, no matter where I have been I have not found any explainations as simple and effective as your – you are a Wordprss and communciation legend. Best wishes.
Hi Mike,
Yes. It is possible to create as many custom page templates as you
like AND have as many custom sidebars as you like on as many custom
page templates. At least I have not had a situation where I've run
into any limitations.
It would become an information management challenge though!
Hope this helps.
Hi Berchman,
Is it possible to make a template where a pagge have different widgets then another.
For example one page with the widget pages and another page with only a widgte links.
So two different custom templates but with the selection witch widget you chose to display.
Thx men
Hi Mike,
you can create as many custom page and custom sidebar options as you like. With the two tutorials on my site the sky is the limit. Hope this helps.
Hi Berchman,
Me again, is it possible to become an template with a specifiek widget in it(so you can choose).
I mean for example home page with widget pages, and newsletter page with only the list with different post in it?
Thx
nokiatips
Oh my gosh, you are the real deal, wow your website creations are simply amazing, congratulations
Hi Berchman,
I found it! With inline style i changed the width too 100%! and that worked…
I love it
Hi Berchman,
I succeded thx to you to do it to change the width of the content.
But the problem now is that i have to do it in a custom template, for example the first page.
Thx again and again 😉
Hi Mike,
If you want the sidebar not to show and the content to be full width
across the available space you will need to do that with CSS. Find the
appropriate < div > and style accordingly.
Let me know if you have any questions.
One more Question Berchman,
How can you merge the content field with the sidebars field.
If i use display:none; for the sidebars it gives an empty field and the text of content doesn't expand in that.
I think that this can be usefull for some of us.
Thx
Hi Peter,
Glad to hear you got it all sorted out. I was going to suggest giving your 'content' div a custom name like 'content-custom-wide' and then controlling that through css to make your page as wide as you like. Let me know if you have any questions.
Fixed this, thanks for all the info!!
Hi Mike,
Glad you got things sorted out. Stay tuned. More tutorials to come.
Berchman,
I think the problem was in mine html code,
Thank to Peter i got the problem solved, i saw the blank page by trying his code, i didn't saw the headline, but probably it's me again ;).
So i am very happy it works.
Thx allot guys and keep the good work up.
A happy Belgium guy
Mike
Great tute, and I successfully created a custom page, but I wanted it to be blank, so I could use a full width table on the page, but I think, I'm being restricted by the content function. It seems to only allow my content to conform to my homepage settings. Therefore the content html will not scale to a greater width, the way the no_sidebar template works by default.
Code used
/* CUSTOM Blank TEMPLATE */
function new_blankpage() {
if (is_page('blank') || is_page('2333')) { ?>
<div id=”content”>
<div class=”post_box”>
<div class=”headline_area”>
<h2>Software And Accessories</h2>
</div>
<?php if (have_posts()) : while (have_posts()) : the_post();?>
<?php the_content(); ?>
<?php endwhile; endif; ?>
</div>
</div>
<?php } }
remove_action('thesis_hook_custom_template', 'thesis_custom_template_sample');
add_action('thesis_hook_custom_template', 'new_blankpage');
Berchman,
Thx for the fast respons.
I followed the instructions in your tutorial so the settings in reading where done, and the custom template was chosenfor the the home page i checked it a couple of times.
What would you see when you chose custom_template? A blank page?
Thx for the effort.
grtz
Mike
Hi Mike,
Thanks very much—appreciate it.
In terms of projects, I take projects on and am “open for business.”
If you like just fill out the form here:
http://berchman.com/hire-a-specialist-that-
and we can get things started.
Best regards,
Bert
paynem
I too thank you so much for creating this tutorial. More so, thank you for sticking around to answer questions. WOW! That alone speaks volumes about you. 🙂 I also want to point out just how helpful Lisa Irby has been in pointing me to your tutorial. I am grateful. Berchman, do you know someone who will accept a project to build a site using Thesis (with a home page and different inner pages)?
Thank you!
Mike
Hi Janie,
You need to click on the “Edit” button, not the “Quick Edit” button.
Hope this helps.
Janie
This is the simpliest of all questions. When I to to quick edit page, the only template I can choose is default. Where are the other options as you show above
Hi Jenny,
You would need to build a custom template to handle this based on what
type of page you are trying to display.
Your conditional would have to test to see if its listing content from
category pages, and then deliver the right custom page template.
Hope this helps.
jennybuttler
Hi there,
I would like for Thesis to display the full post upon clicking on the category instead of just the post title. How do I go about doing this?
My site is simplydelightfuldesigns.com/blog – there are a few tester categories in the sidebar right now, when you click on them, the post titles are in a list.
Dan, this is for newbs and for people new to Thesis.
You need to change reading settings and custom templates on pages because the custom page templates will not be inherited otherwise.
If you want to do some serious customization this tutorial is helpful. If you are happy with Thesis “out of the box” then this tutorial doesn't have much value for you.
Dan
This is for newbs?
Reading settings: Why change this? It already does this.
Switch to custom templates on pages: Why? It works fine.
The advice might be awesome, but it would be helpful to indicate which problems they are a solution to.
Thanks
Hi Doug,
Thanks for the kudos. In terms of “how” to create a custom layout I don't have a resource off the top of my head. However, this makes me think this is a good topic for a tutorial. Stay tuned.
This is a great tutorial. I just got Thesis myself and I'm currently tweaking it for my new design business site. I only have one question: can you link me to any places where they have tutorials on how to build the “custom” layout for these pages? I didn't have a custom home page either and I'd like it to just be like the default Thesis home page, but I haven't a clue how to do that.
Thanks again for the great tutorial. I have bookmarked your site and will be checking out your other articles.
andimac
How do you remove sidebars from a custom page? Probably a really simple question – pardon that.
Great tutorial and thank you for making it very simple and straight forward. Believe it or not I was looking for this exact info for about 5 days now and finally came across your post.
One question about the custom code … How would you display a NexGEN gallery through the custom code in the custom_functions.php page? As it appears right now I only see the 'call' to the page displayed on my page as [slideshow=12].
Any help or nudge in the right direction you could provide would be very helpful. Thanks again!
-Jeff
Giacomo, very creative solution. I am finding Thesis to be extremely flexible. You just need to think things through and you can usually find a solution. Thanks for sharing.
Hi Berchman,
Reading your tutorial and comments was really helpful to me, so I thought I'd give something back by showing how I solved a little problem with custom pages: I needed to have selected pages based on the Custom Template show no heading tags and/or no sidebars –which seemed nearly impossible to accomplish with Thesis 1.5.1, especially the latter.
Here's how I did it:
/* CUSTOM PAGE TEMPLATE */
function custom_page_template() {
if (is_page()) { ?>
<div id=”content”>
<div class=”post_box top”>
<?php if (!is_page('1')) { // No headings on page 1, please.
thesis_headline_area();
}
?>
<div class=”format_text”>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile; endif; ?>
</div>
</div>
</div>
<?php if (is_page('2')) { // No sidebars on page 2, please. ?>
<script type=”text/javascript”>
var content_box_element=document.getElementById('content_box');
content_box_element.className=”no_sidebars”;
</script>
<?php } else { ?>
<div id=”sidebars”>
<?php thesis_build_sidebars(); ?>
</div>
<?php } ?>
<?php } }
remove_action('thesis_hook_custom_template', 'thesis_custom_template_sample');
add_action('thesis_hook_custom_template', 'custom_page_template');
The first conditional PHP block will prevent Thesis from adding a headline_area <div> if the current page ID is 1, producing a page with no <h1> or <h2> tag above its content.
The two lines of JavaScript code within the last conditional block will dynamically add the “no_sidebars” CSS class to the HTML element with “content_box” ID if the current page ID is 2, making that page show no sidebars when the “Custom Template” is selected, while other pages based on the Custom Template will still have sidebars.
You can list one or more page ID's in each conditional block, of course.
Hope you and your readers find this little hack handy!
Frederik
Hi Berchman,
thanks for the great tutorial!
I tried to implement that stuff but got stuck.
What I want to do: all my pages have 2 columns: content +sidebar1.
I'd like the home page to use sidebar 2.
I tried to call the home page up with this
if (is_home() || is_front_page() || is_page('14')) {
?>
and later insert the sidebar like this:
<div id=”show-only-2″>
<?php sidebar_2(); ?>
</div>
Nothing happens on my site though. My guess is that there is something wrong with my first line of code.
I have a static page defined as front page, called Home.
This is how its called when I edith the page:
/page.php?action=edit&post=14
Any advice would be greatly appreciated!
Frederik
Brendan, the images need to be jpg, gif, or png. Tiff format will not work. Hope this helps.
Brendan
Hey,
I have thesis openhook, and m having issues. I have uploaded 10 images (tif files) in to the rotaor folder on my bluehost server, but the images are not showign up on my homepage. Any ideas what the issue may be?
Thanks
Brendan
Very interesting post. I use Thesis on my blog and am very happy with it.
I have been searching for a theme which can support different designs for category pages for my upcoming website…. or rather what you are talking about. Needless to say that I would be using Thesis… but gotta figure out if I can have the cake and eat it too 🙂
Keep up your good work.
careys
Dear Berchman,
I am new to Thesis and have my first site http://www.makesaleseasier.co.uk with Thesis 1.5.1 and own host WordPress 2.8.4. Plug-ins are Akismet, OpenHook & SimpleFlashVideo.
I am trying to remove (or make thinner) the border around the default Multimedia Box. It is a taste issue, but also a test of my learning that I am currently failing at. Please could you tell me if there is a way of controlling the MM box border through the dashboard?
I have find a tutorial on adding a border (http://www.thesishacker.com/put-a-border-around…) and have tried their code suggestion [/*border around mm box*/
.custom #custom_box {border: none; } in custom.ss] to get no border without success. Perhaps this is a syntax or code placement error on my part?
with best regards,
Carey
chinedu
how do i add a slide show to the static page similar to voteshell.com? Thanks for the tutorial, new to wordpress.
BC
Hi Berchman
Let's say my page on my site is http://www.mydomain.com/video
I would then insert something like this in the custom php function page?
function myvideopage {
if(is_video()) { ?>
<?php if (function_exists(“vimeorss”)) { vimeorss(“myfeed”, “videos”, 10, “”, “”, 760, “medium”); } ?>
}
add_action('thesis_hook_before_content','myvideopage');
I'm just not sure if I type video page url which would be the page which holds my videos such as mydomain.com/video?
Hi BC, you would need to write a PHP function to test for that specific page and then insert your custom php function into the proper place within the content div—either before or after the content—and you should get what you want.
BC
Very cool tutorial. What if you just want to keep things and add a custom phpfunction within the content div of a page so it executes your script? Where would you add the function because all I would want it is within the video page and no where else on the website. Thanks
Tim
Thanks Berchman – you have saved me hours of messing about, no matter where I have been I have not found any explainations as simple and effective as your – you are a Wordprss and communciation legend. Best wishes.
Hi Mike,
Yes. It is possible to create as many custom page templates as you
like AND have as many custom sidebars as you like on as many custom
page templates. At least I have not had a situation where I've run
into any limitations.
It would become an information management challenge though!
Hope this helps.
Hi Berchman,
Is it possible to make a template where a pagge have different widgets then another.
For example one page with the widget pages and another page with only a widgte links.
So two different custom templates but with the selection witch widget you chose to display.
Thx men
Hi Mike,
you can create as many custom page and custom sidebar options as you like. With the two tutorials on my site the sky is the limit. Hope this helps.
Hi Berchman,
Me again, is it possible to become an template with a specifiek widget in it(so you can choose).
I mean for example home page with widget pages, and newsletter page with only the list with different post in it?
Thx
nokiatips
Oh my gosh, you are the real deal, wow your website creations are simply amazing, congratulations
Hi Berchman,
I found it! With inline style i changed the width too 100%! and that worked…
I love it
Hi Berchman,
I succeded thx to you to do it to change the width of the content.
But the problem now is that i have to do it in a custom template, for example the first page.
Thx again and again 😉
Hi Mike,
If you want the sidebar not to show and the content to be full width
across the available space you will need to do that with CSS. Find the
appropriate < div > and style accordingly.
Let me know if you have any questions.
One more Question Berchman,
How can you merge the content field with the sidebars field.
If i use display:none; for the sidebars it gives an empty field and the text of content doesn't expand in that.
I think that this can be usefull for some of us.
Thx
Hi Peter,
Glad to hear you got it all sorted out. I was going to suggest giving your 'content' div a custom name like 'content-custom-wide' and then controlling that through css to make your page as wide as you like. Let me know if you have any questions.
Fixed this, thanks for all the info!!
Hi Mike,
Glad you got things sorted out. Stay tuned. More tutorials to come.
Berchman,
I think the problem was in mine html code,
Thank to Peter i got the problem solved, i saw the blank page by trying his code, i didn't saw the headline, but probably it's me again ;).
So i am very happy it works.
Thx allot guys and keep the good work up.
A happy Belgium guy
Mike
Great tute, and I successfully created a custom page, but I wanted it to be blank, so I could use a full width table on the page, but I think, I'm being restricted by the content function. It seems to only allow my content to conform to my homepage settings. Therefore the content html will not scale to a greater width, the way the no_sidebar template works by default.
Code used
/* CUSTOM Blank TEMPLATE */
function new_blankpage() {
if (is_page('blank') || is_page('2333')) { ?>
<div id=”content”>
<div class=”post_box”>
<div class=”headline_area”>
<h2>Software And Accessories</h2>
</div>
<?php if (have_posts()) : while (have_posts()) : the_post();?>
<?php the_content(); ?>
<?php endwhile; endif; ?>
</div>
</div>
<?php } }
remove_action('thesis_hook_custom_template', 'thesis_custom_template_sample');
add_action('thesis_hook_custom_template', 'new_blankpage');
Berchman,
Thx for the fast respons.
I followed the instructions in your tutorial so the settings in reading where done, and the custom template was chosenfor the the home page i checked it a couple of times.
What would you see when you chose custom_template? A blank page?
Thx for the effort.
grtz
Mike
Hi Mike,
Thanks very much—appreciate it.
In terms of projects, I take projects on and am “open for business.”
If you like just fill out the form here:
http://berchman.com/hire-a-specialist-that-
and we can get things started.
Best regards,
Bert
paynem
I too thank you so much for creating this tutorial. More so, thank you for sticking around to answer questions. WOW! That alone speaks volumes about you. 🙂 I also want to point out just how helpful Lisa Irby has been in pointing me to your tutorial. I am grateful. Berchman, do you know someone who will accept a project to build a site using Thesis (with a home page and different inner pages)?
Thank you!
Mike
Hi Janie,
You need to click on the “Edit” button, not the “Quick Edit” button.
Hope this helps.
Hi Jenny,
You would need to build a custom template to handle this based on what
type of page you are trying to display.
Your conditional would have to test to see if its listing content from
category pages, and then deliver the right custom page template.
Hope this helps.
Janie
This is the simpliest of all questions. When I to to quick edit page, the only template I can choose is default. Where are the other options as you show above
jennybuttler
Hi there,
I would like for Thesis to display the full post upon clicking on the category instead of just the post title. How do I go about doing this?
My site is simplydelightfuldesigns.com/blog – there are a few tester categories in the sidebar right now, when you click on them, the post titles are in a list.
Dan, this is for newbs and for people new to Thesis.
You need to change reading settings and custom templates on pages because the custom page templates will not be inherited otherwise.
If you want to do some serious customization this tutorial is helpful. If you are happy with Thesis “out of the box” then this tutorial doesn't have much value for you.
Dan
This is for newbs?
Reading settings: Why change this? It already does this.
Switch to custom templates on pages: Why? It works fine.
The advice might be awesome, but it would be helpful to indicate which problems they are a solution to.
Thanks
Hi Doug,
Thanks for the kudos. In terms of “how” to create a custom layout I don't have a resource off the top of my head. However, this makes me think this is a good topic for a tutorial. Stay tuned.
This is a great tutorial. I just got Thesis myself and I'm currently tweaking it for my new design business site. I only have one question: can you link me to any places where they have tutorials on how to build the “custom” layout for these pages? I didn't have a custom home page either and I'd like it to just be like the default Thesis home page, but I haven't a clue how to do that.
Thanks again for the great tutorial. I have bookmarked your site and will be checking out your other articles.
andimac
How do you remove sidebars from a custom page? Probably a really simple question – pardon that.
Great tutorial and thank you for making it very simple and straight forward. Believe it or not I was looking for this exact info for about 5 days now and finally came across your post.
One question about the custom code … How would you display a NexGEN gallery through the custom code in the custom_functions.php page? As it appears right now I only see the 'call' to the page displayed on my page as [slideshow=12].
Any help or nudge in the right direction you could provide would be very helpful. Thanks again!
-Jeff
Giacomo, very creative solution. I am finding Thesis to be extremely flexible. You just need to think things through and you can usually find a solution. Thanks for sharing.
Hi Berchman,
Reading your tutorial and comments was really helpful to me, so I thought I'd give something back by showing how I solved a little problem with custom pages: I needed to have selected pages based on the Custom Template show no heading tags and/or no sidebars –which seemed nearly impossible to accomplish with Thesis 1.5.1, especially the latter.
Here's how I did it:
/* CUSTOM PAGE TEMPLATE */
function custom_page_template() {
if (is_page()) { ?>
<div id=”content”>
<div class=”post_box top”>
<?php if (!is_page('1')) { // No headings on page 1, please.
thesis_headline_area();
}
?>
<div class=”format_text”>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile; endif; ?>
</div>
</div>
</div>
<?php if (is_page('2')) { // No sidebars on page 2, please. ?>
<script type=”text/javascript”>
var content_box_element=document.getElementById('content_box');
content_box_element.className=”no_sidebars”;
</script>
<?php } else { ?>
<div id=”sidebars”>
<?php thesis_build_sidebars(); ?>
</div>
<?php } ?>
<?php } }
remove_action('thesis_hook_custom_template', 'thesis_custom_template_sample');
add_action('thesis_hook_custom_template', 'custom_page_template');
The first conditional PHP block will prevent Thesis from adding a headline_area <div> if the current page ID is 1, producing a page with no <h1> or <h2> tag above its content.
The two lines of JavaScript code within the last conditional block will dynamically add the “no_sidebars” CSS class to the HTML element with “content_box” ID if the current page ID is 2, making that page show no sidebars when the “Custom Template” is selected, while other pages based on the Custom Template will still have sidebars.
You can list one or more page ID's in each conditional block, of course.
Hope you and your readers find this little hack handy!
Frederik
Hi Berchman,
thanks for the great tutorial!
I tried to implement that stuff but got stuck.
What I want to do: all my pages have 2 columns: content +sidebar1.
I'd like the home page to use sidebar 2.
I tried to call the home page up with this
if (is_home() || is_front_page() || is_page('14')) {
?>
and later insert the sidebar like this:
<div id=”show-only-2″>
<?php sidebar_2(); ?>
</div>
Nothing happens on my site though. My guess is that there is something wrong with my first line of code.
I have a static page defined as front page, called Home.
This is how its called when I edith the page:
/page.php?action=edit&post=14
Any advice would be greatly appreciated!
Frederik
Brendan, the images need to be jpg, gif, or png. Tiff format will not work. Hope this helps.
Brendan
Hey,
I have thesis openhook, and m having issues. I have uploaded 10 images (tif files) in to the rotaor folder on my bluehost server, but the images are not showign up on my homepage. Any ideas what the issue may be?
Thanks
Brendan
Very interesting post. I use Thesis on my blog and am very happy with it.
I have been searching for a theme which can support different designs for category pages for my upcoming website…. or rather what you are talking about. Needless to say that I would be using Thesis… but gotta figure out if I can have the cake and eat it too 🙂
Keep up your good work.
careys
Dear Berchman,
I am new to Thesis and have my first site http://www.makesaleseasier.co.uk with Thesis 1.5.1 and own host WordPress 2.8.4. Plug-ins are Akismet, OpenHook & SimpleFlashVideo.
I am trying to remove (or make thinner) the border around the default Multimedia Box. It is a taste issue, but also a test of my learning that I am currently failing at. Please could you tell me if there is a way of controlling the MM box border through the dashboard?
I have find a tutorial on adding a border (http://www.thesishacker.com/put-a-border-around…) and have tried their code suggestion [/*border around mm box*/
.custom #custom_box {border: none; } in custom.ss] to get no border without success. Perhaps this is a syntax or code placement error on my part?
with best regards,
Carey
chinedu
how do i add a slide show to the static page similar to voteshell.com? Thanks for the tutorial, new to wordpress.
BC
Hi Berchman
Let's say my page on my site is http://www.mydomain.com/video
I would then insert something like this in the custom php function page?
function myvideopage {
if(is_video()) { ?>
<?php if (function_exists(“vimeorss”)) { vimeorss(“myfeed”, “videos”, 10, “”, “”, 760, “medium”); } ?>
}
add_action('thesis_hook_before_content','myvideopage');
I'm just not sure if I type video page url which would be the page which holds my videos such as mydomain.com/video?
Hi BC, you would need to write a PHP function to test for that specific page and then insert your custom php function into the proper place within the content div—either before or after the content—and you should get what you want.
BC
Very cool tutorial. What if you just want to keep things and add a custom phpfunction within the content div of a page so it executes your script? Where would you add the function because all I would want it is within the video page and no where else on the website. Thanks
Tim
Thanks Berchman – you have saved me hours of messing about, no matter where I have been I have not found any explainations as simple and effective as your – you are a Wordprss and communciation legend. Best wishes.
Hi Mike,
Yes. It is possible to create as many custom page templates as you
like AND have as many custom sidebars as you like on as many custom
page templates. At least I have not had a situation where I've run
into any limitations.
It would become an information management challenge though!
Hope this helps.
Hi Berchman,
Is it possible to make a template where a pagge have different widgets then another.
For example one page with the widget pages and another page with only a widgte links.
So two different custom templates but with the selection witch widget you chose to display.
Thx men
Hi Mike,
you can create as many custom page and custom sidebar options as you like. With the two tutorials on my site the sky is the limit. Hope this helps.
Hi Berchman,
Me again, is it possible to become an template with a specifiek widget in it(so you can choose).
I mean for example home page with widget pages, and newsletter page with only the list with different post in it?
Thx
nokiatips
Oh my gosh, you are the real deal, wow your website creations are simply amazing, congratulations
Hi Berchman,
I found it! With inline style i changed the width too 100%! and that worked…
I love it
Hi Berchman,
I succeded thx to you to do it to change the width of the content.
But the problem now is that i have to do it in a custom template, for example the first page.
Thx again and again 😉
Hi Mike,
If you want the sidebar not to show and the content to be full width
across the available space you will need to do that with CSS. Find the
appropriate < div > and style accordingly.
Let me know if you have any questions.
One more Question Berchman,
How can you merge the content field with the sidebars field.
If i use display:none; for the sidebars it gives an empty field and the text of content doesn't expand in that.
I think that this can be usefull for some of us.
Thx
Hi Peter,
Glad to hear you got it all sorted out. I was going to suggest giving your 'content' div a custom name like 'content-custom-wide' and then controlling that through css to make your page as wide as you like. Let me know if you have any questions.
Fixed this, thanks for all the info!!
Hi Mike,
Glad you got things sorted out. Stay tuned. More tutorials to come.
Berchman,
I think the problem was in mine html code,
Thank to Peter i got the problem solved, i saw the blank page by trying his code, i didn't saw the headline, but probably it's me again ;).
So i am very happy it works.
Thx allot guys and keep the good work up.
A happy Belgium guy
Mike
Great tute, and I successfully created a custom page, but I wanted it to be blank, so I could use a full width table on the page, but I think, I'm being restricted by the content function. It seems to only allow my content to conform to my homepage settings. Therefore the content html will not scale to a greater width, the way the no_sidebar template works by default.
Code used
/* CUSTOM Blank TEMPLATE */
function new_blankpage() {
if (is_page('blank') || is_page('2333')) { ?>
<div id=”content”>
<div class=”post_box”>
<div class=”headline_area”>
<h2>Software And Accessories</h2>
</div>
<?php if (have_posts()) : while (have_posts()) : the_post();?>
<?php the_content(); ?>
<?php endwhile; endif; ?>
</div>
</div>
<?php } }
remove_action('thesis_hook_custom_template', 'thesis_custom_template_sample');
add_action('thesis_hook_custom_template', 'new_blankpage');
Berchman,
Thx for the fast respons.
I followed the instructions in your tutorial so the settings in reading where done, and the custom template was chosenfor the the home page i checked it a couple of times.
What would you see when you chose custom_template? A blank page?
Thx for the effort.
grtz
Mike
Hi Mike,
Thanks very much—appreciate it.
In terms of projects, I take projects on and am “open for business.”
If you like just fill out the form here:
http://berchman.com/hire-a-specialist-that-
and we can get things started.
Best regards,
Bert
paynem
I too thank you so much for creating this tutorial. More so, thank you for sticking around to answer questions. WOW! That alone speaks volumes about you. 🙂 I also want to point out just how helpful Lisa Irby has been in pointing me to your tutorial. I am grateful. Berchman, do you know someone who will accept a project to build a site using Thesis (with a home page and different inner pages)?
Thank you!
Mike
Janie
This is the simpliest of all questions. When I to to quick edit page, the only template I can choose is default. Where are the other options as you show above
jennybuttler
Hi there,
I would like for Thesis to display the full post upon clicking on the category instead of just the post title. How do I go about doing this?
My site is simplydelightfuldesigns.com/blog – there are a few tester categories in the sidebar right now, when you click on them, the post titles are in a list.
Giacomo, very creative solution. I am finding Thesis to be extremely flexible. You just need to think things through and you can usually find a solution. Thanks for sharing.
Brendan, the images need to be jpg, gif, or png. Tiff format will not work. Hope this helps.
Dan, this is for newbs and for people new to Thesis.
You need to change reading settings and custom templates on pages because the custom page templates will not be inherited otherwise.
If you want to do some serious customization this tutorial is helpful. If you are happy with Thesis “out of the box” then this tutorial doesn't have much value for you.
Hi Doug,
Thanks for the kudos. In terms of “how” to create a custom layout I don't have a resource off the top of my head. However, this makes me think this is a good topic for a tutorial. Stay tuned.
Dan
This is for newbs?
Reading settings: Why change this? It already does this.
Switch to custom templates on pages: Why? It works fine.
The advice might be awesome, but it would be helpful to indicate which problems they are a solution to.
Thanks
This is a great tutorial. I just got Thesis myself and I'm currently tweaking it for my new design business site. I only have one question: can you link me to any places where they have tutorials on how to build the “custom” layout for these pages? I didn't have a custom home page either and I'd like it to just be like the default Thesis home page, but I haven't a clue how to do that.
Thanks again for the great tutorial. I have bookmarked your site and will be checking out your other articles.
This is a great tutorial. I just got Thesis myself and I'm currently tweaking it for my new design business site. I only have one question: can you link me to any places where they have tutorials on how to build the “custom” layout for these pages? I didn't have a custom home page either and I'd like it to just be like the default Thesis home page, but I haven't a clue how to do that.
Thanks again for the great tutorial. I have bookmarked your site and will be checking out your other articles.
andimac
How do you remove sidebars from a custom page? Probably a really simple question – pardon that.
Great tutorial and thank you for making it very simple and straight forward. Believe it or not I was looking for this exact info for about 5 days now and finally came across your post.
One question about the custom code … How would you display a NexGEN gallery through the custom code in the custom_functions.php page? As it appears right now I only see the 'call' to the page displayed on my page as [slideshow=12].
Any help or nudge in the right direction you could provide would be very helpful. Thanks again!
-Jeff
Hi Berchman,
Reading your tutorial and comments was really helpful to me, so I thought I'd give something back by showing how I solved a little problem with custom pages: I needed to have selected pages based on the Custom Template show no heading tags and/or no sidebars –which seemed nearly impossible to accomplish with Thesis 1.5.1, especially the latter.
Here's how I did it:
/* CUSTOM PAGE TEMPLATE */
function custom_page_template() {
if (is_page()) { ?>
<div id=”content”>
<div class=”post_box top”>
<?php if (!is_page('1')) { // No headings on page 1, please.
thesis_headline_area();
}
?>
<div class=”format_text”>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile; endif; ?>
</div>
</div>
</div>
<?php if (is_page('2')) { // No sidebars on page 2, please. ?>
<script type=”text/javascript”>
var content_box_element=document.getElementById('content_box');
content_box_element.className=”no_sidebars”;
</script>
<?php } else { ?>
<div id=”sidebars”>
<?php thesis_build_sidebars(); ?>
</div>
<?php } ?>
<?php } }
remove_action('thesis_hook_custom_template', 'thesis_custom_template_sample');
add_action('thesis_hook_custom_template', 'custom_page_template');
The first conditional PHP block will prevent Thesis from adding a headline_area <div> if the current page ID is 1, producing a page with no <h1> or <h2> tag above its content.
The two lines of JavaScript code within the last conditional block will dynamically add the “no_sidebars” CSS class to the HTML element with “content_box” ID if the current page ID is 2, making that page show no sidebars when the “Custom Template” is selected, while other pages based on the Custom Template will still have sidebars.
You can list one or more page ID's in each conditional block, of course.
Hope you and your readers find this little hack handy!
Frederik
Hi Berchman,
thanks for the great tutorial!
I tried to implement that stuff but got stuck.
What I want to do: all my pages have 2 columns: content +sidebar1.
I'd like the home page to use sidebar 2.
I tried to call the home page up with this
if (is_home() || is_front_page() || is_page('14')) {
?>
and later insert the sidebar like this:
<div id=”show-only-2″>
<?php sidebar_2(); ?>
</div>
Nothing happens on my site though. My guess is that there is something wrong with my first line of code.
I have a static page defined as front page, called Home.
This is how its called when I edith the page:
/page.php?action=edit&post=14
Any advice would be greatly appreciated!
Frederik
Brendan
Hey,
I have thesis openhook, and m having issues. I have uploaded 10 images (tif files) in to the rotaor folder on my bluehost server, but the images are not showign up on my homepage. Any ideas what the issue may be?
Thanks
Brendan
Very interesting post. I use Thesis on my blog and am very happy with it.
I have been searching for a theme which can support different designs for category pages for my upcoming website…. or rather what you are talking about. Needless to say that I would be using Thesis… but gotta figure out if I can have the cake and eat it too 🙂
Keep up your good work.
careys
Dear Berchman,
I am new to Thesis and have my first site http://www.makesaleseasier.co.uk with Thesis 1.5.1 and own host WordPress 2.8.4. Plug-ins are Akismet, OpenHook & SimpleFlashVideo.
I am trying to remove (or make thinner) the border around the default Multimedia Box. It is a taste issue, but also a test of my learning that I am currently failing at. Please could you tell me if there is a way of controlling the MM box border through the dashboard?
I have find a tutorial on adding a border (http://www.thesishacker.com/put-a-border-around…) and have tried their code suggestion [/*border around mm box*/
.custom #custom_box {border: none; } in custom.ss] to get no border without success. Perhaps this is a syntax or code placement error on my part?
with best regards,
Carey
chinedu
how do i add a slide show to the static page similar to voteshell.com? Thanks for the tutorial, new to wordpress.
BC
Hi Berchman
Let's say my page on my site is http://www.mydomain.com/video
I would then insert something like this in the custom php function page?
function myvideopage {
if(is_video()) { ?>
<?php if (function_exists(“vimeorss”)) { vimeorss(“myfeed”, “videos”, 10, “”, “”, 760, “medium”); } ?>
}
add_action('thesis_hook_before_content','myvideopage');
I'm just not sure if I type video page url which would be the page which holds my videos such as mydomain.com/video?
Hi BC, you would need to write a PHP function to test for that specific page and then insert your custom php function into the proper place within the content div—either before or after the content—and you should get what you want.
Hi Mike,
you can create as many custom page and custom sidebar options as you like. With the two tutorials on my site the sky is the limit. Hope this helps.
BC
Very cool tutorial. What if you just want to keep things and add a custom phpfunction within the content div of a page so it executes your script? Where would you add the function because all I would want it is within the video page and no where else on the website. Thanks
Tim
Thanks Berchman – you have saved me hours of messing about, no matter where I have been I have not found any explainations as simple and effective as your – you are a Wordprss and communciation legend. Best wishes.
berchman
Hi Mike,
Yes. It is possible to create as many custom page templates as you
like AND have as many custom sidebars as you like on as many custom
page templates. At least I have not had a situation where I've run
into any limitations.
It would become an information management challenge though!
Hope this helps.
Hi Berchman,
Is it possible to make a template where a pagge have different widgets then another.
For example one page with the widget pages and another page with only a widgte links.
So two different custom templates but with the selection witch widget you chose to display.
Thx men
Hi Berchman,
Me again, is it possible to become an template with a specifiek widget in it(so you can choose).
I mean for example home page with widget pages, and newsletter page with only the list with different post in it?
Thx
nokiatips
Oh my gosh, you are the real deal, wow your website creations are simply amazing, congratulations
berchman
Hi Mike,
Thanks very much—appreciate it.
In terms of projects, I take projects on and am “open for business.”
If you like just fill out the form here:
http://berchman.com/hire-a-specialist-that-
and we can get things started.
Best regards,
Bert
paynem
I too thank you so much for creating this tutorial. More so, thank you for sticking around to answer questions. WOW! That alone speaks volumes about you. 🙂 I also want to point out just how helpful Lisa Irby has been in pointing me to your tutorial. I am grateful. Berchman, do you know someone who will accept a project to build a site using Thesis (with a home page and different inner pages)?
Thank you!
Mike
Hi Berchman,
I found it! With inline style i changed the width too 100%! and that worked…
I love it
Hi Berchman,
I succeded thx to you to do it to change the width of the content.
But the problem now is that i have to do it in a custom template, for example the first page.
Thx again and again 😉
berchman
Hi Mike,
If you want the sidebar not to show and the content to be full width
across the available space you will need to do that with CSS. Find the
appropriate < div > and style accordingly.
Let me know if you have any questions.
One more Question Berchman,
How can you merge the content field with the sidebars field.
If i use display:none; for the sidebars it gives an empty field and the text of content doesn't expand in that.
I think that this can be usefull for some of us.
Thx
berchman
Hi Peter,
Glad to hear you got it all sorted out. I was going to suggest giving your 'content' div a custom name like 'content-custom-wide' and then controlling that through css to make your page as wide as you like. Let me know if you have any questions.
berchman
Hi Mike,
Glad you got things sorted out.
Berchman,
I think the problem was in mine html code,
Thank to Peter i got the problem solved, i saw the blank page by trying his code, i didn't saw the headline, but probably it's me again ;).
So i am very happy it works.
Thx allot guys and keep the good work up.
A happy Belgium guy
Mike
Fixed this, thanks for all the info!!
Great tute, and I successfully created a custom page, but I wanted it to be blank, so I could use a full width table on the page, but I think, I'm being restricted by the content function. It seems to only allow my content to conform to my homepage settings. Therefore the content html will not scale to a greater width, the way the no_sidebar template works by default.
Code used
/* CUSTOM Blank TEMPLATE */
function new_blankpage() {
if (is_page('blank') || is_page('2333')) { ?>
<div id=”content”>
<div class=”post_box”>
<div class=”headline_area”>
<h2>Software And Accessories</h2>
</div>
<?php if (have_posts()) : while (have_posts()) : the_post();?>
<?php the_content(); ?>
<?php endwhile; endif; ?>
</div>
</div>
<?php } }
remove_action('thesis_hook_custom_template', 'thesis_custom_template_sample');
add_action('thesis_hook_custom_template', 'new_blankpage');
Berchman,
Thx for the fast respons.
I followed the instructions in your tutorial so the settings in reading where done, and the custom template was chosenfor the the home page i checked it a couple of times.
What would you see when you chose custom_template? A blank page?
Thx for the effort.
grtz
Mike
Hi Mike,
Are you certain that in the ‘settings/reading’ page in the admin area that you have the ‘static’ radio button selected and then select the appropriate page from the pulldown menu? This coupled with selecting ‘custom template’ when viewing the page in the ‘edit’ mode should do the trick.
Let me know if you have any questions.
Hope this helps.
Hi Berchman,
I like your tutorial, but in a way it doesnt work.
I followed your steps, but somethings seems to go wrong, i mean there is nothing changed on the page i chose for being the custom template. Maybe it’s in the code? Do i only have to copy your code or should i change something? like this: if (is_home() || is_front_page()).
Sorry for being a noob.
Sherwin
Please forgive me if i don’t make sense. I would like to have every page in my blog with a different design (not more than 100 pages). Do i have to use Custom Pages for each page. If Yes, will the custom_functions.php page get too long for my blog to work because i see that i have to add each custom page code to the custom_functions.php page. Please help me understand.
Sherwin, In theory you have it correct. It really depends on how different each design is. If they are all completely different (quite an undertaking!) then yes you would need custom code for each page. However, if many/most of the pages would share common elements, ie. a certain sidebar will show on pages 1, 5, 27, 45, etc. then you could write functions for each of those page elements and create cascading if-then-else statements to ‘mash-up’ your pages as you need them to appear. Each distinct page element would need its own function. Let me know if you have any questions. Hope this helps.
Kaz, are you trying this with all pages of the site? Or a specific one? If so, can you give me the exact URL?
==
robyn, yes. you have to apply the template using the sidebar pulldown in the page editor AND specify the page in the custom_function.php conditional.
==
aaron, yes you have it correct and what you explained is what robyn is asking.
==
marek, you are welcome.
Marek
Man, you just saved my life.
aaron
i think i just figured it out…. you select custom, and then based on your function (if page is _____) it will use that code.
aaron
I have had no need to modify the home page, but have needed an extra template (client needs to show two authors content on the same page and styled differently). So, I created this:
function another_page() {
if (is_page(‘another’) || is_page(‘134343’)) { ?>
stuff goes here
<?php } }
remove_action('thesis_hook_custom_template','thesis_custom_template_sample');
add_action('thesis_hook_custom_template', 'another_page');
I do not get an error, but the "template" doesn't show up as an option when I go to create the page.
How do I get it to show up? thanks
robyn
So berchman, if I only want to change subsequent pages, can I leave the front page as is (not create a custom template) and only create custom templates for pages I want to adjust sidebars in?
Hi – I’ve persevered with this (as well as the sidebars tute). I put this in custom functions:
function home_pagecustom() {
if (is_home() || is_front_page()) { ?>
<?php the_title('’, ”); ?>
Not Found
Sorry, but you are looking for something that isn’t here.
<?php } }
remove_action('thesis_hook_custom_template', 'thesis_custom_template_sample');
add_action('thesis_hook_custom_template', 'home_pagecustom');
and it did something but looked odd!
So I put this in custom css:
home_pagecustom{width:820px;}
And realise that probably not the right call but I tried most other things; still did not look right.
I seem to be getting these templates to call up; but I just can't get the sitting right! Can anyone tell me what on earth I am doing wrong both with this and my sidebar template. Is it the way I am custom css-ing it.
Yours patiently and back to the standard sidebars for now!
Is there a way to have it register the custom templates inside WordPress instead of basing it off the page id? That way, the user could just pick it on the sidebar while authoring the content.
Hi Melvin, You are wanting the custom templates you create to show in the sidebar pulldown. To the best of my knowledge within the Thesis framework that is not possible. I have nto read or heard of someone being able to do that. However, if given enough time to work on it I imagine anything is possible. I would post this question to the Thesis forums to the larger Thesis audience.
Alex
This tutorial is great, but I am still having issues.
I want my header, footer, and sidebar to remain the same, but I am placing content within the content div. It displays only the header and the new content, but not the sidebars.
Alex, do you have a link you can email me so I can take a look? It sounds like a div nesting issue.
Your coding started with div id=”content” . How do I ensure that the standard header and footer will remain intact and that I’m just replacing the middle area (regardless of how many sidebars I have)?
I want the header and footer but, three static columns for the middle that I’ll add javascript to.
Your tutorial kicks some ass, man.
Hi Shane,
As long as you are using standard Thesis templates the code in that tutorial only replaces the center content. The header and footer show as they should on all other pages/posts. Let me know if you have any questions.
Andrew
Nice tutorial. I’m wondering, is it possible to put some custom php inside these hooks? What I’m trying to do is insert a shopping cart (which calls to a separate MySQL database) inside a specific Thesis WP page. I’ve done this in other standard WordPress templates, but having a hard time inside Thesis. Any advice?
Hi Andrew, You can put custom php inside the hooks. It just a matter of tweaking until things work as you want. You may also want to checkout Open Hook. It may help as well: http://rickbeckman.org/thesis-openhook/
BTW, I wrote a simplifed version on how to create custom sidebars to go with your custom pages over at the official support forum: http://diythemes.com/forums/support/6039-sidebar-content-different-each-page.html
Hi Marcus, Thanks for the comments. BTW you might check out my custom sidebar tutorial as well. Let me know if you have any questions.
Thank you! I have been doing some modifications on Thesis and your little guide here rocks Mr!
Thanks / Marcus
Hi, Thanks for this tutorial. Im still a little unclear. On my site I basically want the home page to be 2 columns and all the rest of my site (which are just different categories for my blog) to be 3 column as they are now.
I want to put the FCG on the home page only, in one of the columns and the other column would have the most current blog post. I want the nav bar to be the same on all pages/posts.
Ive created a page called “home”, and set it at “custom template” and called it “static home page” and put the code in “customs_functions.” But not sure what I do now. Do I have to do the styling by code or can’t I go in and set up the columns for this home page in “thesis design options.” Am I making any sense here? Thank you for any help. I am a beginner but Ive accomplished alot (in my mind) so far in my newbie state : )
Hi Allison,
You are definitely on the right track. The key is inside custom_functions.php. The function you write to replace the home page has to be called by the proper “hooks.” If your homepage looks like the rest of the site, and you have double checked that you have it set for ‘custom template’ in the pulldown, then I suspect the culprit is how you are using Thesis hooks to call the function and replace the homepage template. If the hooks were working your homepage would look different than the other pages, even if your home page template was not 100% accurate. The hooks would replace it anyway.
Take a look at the references about hooks and how you have them implemented. Then let me know if you have any questions. Hope this helps.
Great article. Allowed me to get some of the home page lookin just as I wanted. But now I’m stuck again. I’ve inserted my own static code on the home page now I want excepts of my posts to be listed – I’ve tried putting all the loop commands in my copy of your code and I only get a blank copy of my Home page – with lovely sidebars, header etc. Please point me in the right direction to get the piece I’m missing. I checked the forums to see if anyone else had posted but I didn’t see anything so I’m back to ask you – since I’m sure you know. Thanks a lot
Hi Jennifer,
If what you want is to list just the excerpts of your posts you should refer to excerpt basics here: http://bit.ly/19mirP
If you email me your custom_functions file I could take a look.
I’ve read and re-read this article, as well as your more recent post on custom sidebars. I still have a couple of questions I hope you can help me with:
1. I have a three column layout, with sidebars on either side of the content. For some pages, I’d like to get rid of the left sidebar and enlarge the content area. What’s the best way to accomplish this?
2. I use conditionals on my custom_function file to create content sensitive sidebars. It’s not pretty, but it gets the job done. For pages, would the better way be to use the custom template, or does it not really matter?
Thanks.
Hi Dough Roller,
For #1 if it is indeed for ‘some’ pages then I would create a custom page template and build the template layout to have only one sidebar. I would also “ID” the content area as ‘content-wide’ and then use css to style appropriately.
For #2 it depends. Many times there are multiple ways to ‘skin it’ so its just a matter of efficiency. If what you have going works for your purposes then ‘if it ain’t broke, don’t fix it.”
Hope this helps.
GP
Lovely, now I’ll just get my smart hat on and reread Rae’s ‘hooks’ “clarification’ and try not to hurt anyone in the meantime. HOWEVER — if anyone can point me to who can do this for me for $, I’m all ears. Thanks ~ !
Nicky
Yo Berchman, I’m eagerly waiting for your tutorial to have different sidebars on different pages.
Regards,
Nicky
George and Nicky,
Was having issues with my own Thesis install and had to work those out.
I should have the new sidebar tutorial up soon. Stay tuned.
George
Hey berchman,
Thanks for the great stuff. On a May 9th comment (above) you said something about a tutorial you were making on creating pages with their own custom sidebars.
Have you got that done yet or can you direct me to a source where I can learn about how to have different sidebars on different pages in Thesis?
Thanks.
Hi again,
I followed all your instructions and can get it to pull the custom template (which is just a grey box for now). The problem is that the custom template doesn’t pull the content that I have written through the dashboard. It’s only pulling the content that I put in the custom_functions_php file. I don’t know php so I’m a bit blind here. My intention is to be able to add all content through the dashboard and have one sidebar (sidebar 1) on the right. Any help is SO appreciated. Thanks!
Hi Mary,
You most likely need to run the WordPress “loop” and pull the content you want in that way. You can read more about the loop here:
http://codex.wordpress.org/The_Loop
Here is an example I use to pull the content for a homepage. You must have the page ID’d as the home page in Settings/Reading
function home_pagecustom() {
if (is_home() || is_front_page())  {
?>

Not Found

Sorry, but you are looking for something that isn't here.
Let me know if you have any questions.
Hope this helps.
This was very helpful. I’ve been wanting a custom Thesis homepage for awhile now and just never took the time to learn how. I am testing this on my local machine and it works like a charm. Appreciate it. 🙂
Thanks for the kudos Lisa. I checked out your website. Quite cool. I like how you are keeping it real for people. Great topics, great content. Cheers!
Mary Baker
I am using Thesis 15 and want to have custom templates for some of my pages. How can I add content within the dashboard with a page that is using a custom template?
Hi Mary,
You first need to create a new page and add its content. While viewing the page you make sure you have “Custom Template” selected from the right side pulldown menu (look at the tutorial above, it is spelled out). Once you have that done you need to go through the coding process I have outlined above ( in custom_functions.php ). This way the page is looking for its custom template and it is applied appropriately. Hope this helps.
Nicky
That sounds really good Berchman, I’ll be looking forward to it. So far, I’ve managed to add the sidebars but I’m not able to get the layout of s3-content-s4.
Thanks,
Nicky
Nicky
Hey Berchman,
Thanks for the tutorial. This is somewhat related to what I’m trying to do.
I have a query. I want to show two sidebars (3, and 4) different than the ones displayed on homepage and rest of blog. How do I go about it? I want the layout to be s3-content-s4.
Any help on this would be great!
Thanks
Hi Nicky,
Thanks. I should have the sidebar tutorial online by end-of-day Monday (hopefully sooner if possible). Stay tuned.
Cheers,
berchman
Great tutorial. I’m a relative newbie and got it working on my test site using your example. However, my goal is to create a custom template that uses a different header image than the rest of the site. The navigation tabs would stay the same; I pretty much just want to be able to specify a certain header image for certain pages. Your tutorial seems to just include the stuff under the header and before the footer. Any advice on how to proceed?
Thanks!
Hi Jason,
Thanks for the compliment. As is the case in many things WordPress there is more than one way to tackle what you want to do with your headers. However, since we are working within Thesis I think the best thing to do is to build a subroutine that tests for pages/posts/categories and then inserts the correct header. Then you could run that subroutine in the standard Thesis template using hooks, or if you have custom page templates you could reference the ‘custom_header_subroutine’ within it.
BTW, checked out your website. So cool! I needed a reminder about escaping adulthood. Is that the website you are looking to use Thesis with?
Let me know if you have any questions.
Hi there,
This is somewhat what I have been looking for Thanks.
I’m new to blogs all together and starting a new RE site.
see link- http://www.carealproperties.com/
I would like to set sub pagers to my site a little different than my home page and my two question’s are as follows:
1) As you can see my areas of service are in the left sidebar and those links take a user to a static city page that also has the left & right sidebar. (I would like to keep the left sidebar on all pagers.) On the sub pagers only I would like to change the right sidebar to break up the cities into neighborhoods.
2) On the sub pagers I would like to have a static introductory section at the top of each of the cities and neighborhood pagers that will not get lost in the archives. In other words I would like any posts to be below the static Introductory.
I don’t even know if it is possible and I would greatly appreciate advice. “)
Hi CARP,
Yes, you most certainly can do what you are after. In fact I am in the process of finishing up a tutorial on multiple-sidebar-options. In the default WordPress/Thesis environment you only have 2 sidebar options. My tutorial will show you how to create as MANY sidebars as you want/need and how to use it in combination with the principles in this tutorial to get exactly what you are after. I should have this tutorial published within the next week.
Hope this helps.
Hi Paul,
Thanks for the link to the plugin.
Thinking about this ID issue I realized I may not have been specific enough. By default you should see it in the bar at the bottom of your browser, not necessarily on the ‘tool tip’ hover. If you have changed your permalink structure in the admin tools of WordPress then this would not work either (as is the case on this website) and the plugin would be the way to go.
Let me know if you have any questions.
Paul B
Nevermind… I found out why! As of wp2.5 the ID is not shown anymore.
Here is a plugin to display it though, and it works well for me.
Paul B
When I try tofind a page ID by hovering…over the link to edit the page when viewing a page list within the admin area of WordPress., it does not show the page ID. It only shows the name (title) of the page.
Question 1, Is there something that has changed in WP 2.7 or Thesis 1.5 that behaves differently than when you wrote this tutorial?
Question 2, Is there an alternate way of finding a page’s ID? Besides opening up the DB and finding it there, of course(~:
Hi Julie,
Yes, you do get the source code from other files that are setup how you like combined with the customizations that you want.
You also need to identify the page you want to have this custom template applied to and develop the right logic so it happens how you want it to.
You asked where to find source code that is being used for the pages. You can find it in here. NOTE: Don’t edit files inside this directory or you are playing with fire. 🙂
You may open the files in this directory to copy/paste elements into your custom_functions.php to play around and get what you are after.
Hope this helps.
Thanks for this awesome tutorial, and for the link to the Sugarrae article on hooks. Despite the excellent advice, I still don’t have my custom templates working the way I want.
I have a simple home page, which I’ve already set up. I want subsequent pages to be very similar – same navigation, smaller banner across the top, fewer sidebar elements.
I’ve got the custom_functions.php file downloaded, but I’m not sure what to enter for the custom content. I don’t want to do the html – I want to duplicate *most* of what’s on the other pages. Where do I get the code? Do I copy it from the various templates in the WordPress editor?
Can’t help but think I’m missing something obvious here…
Actually, Alex explained my frustrations much better, and in your response to Alex you suggestions the following:
You can try this link for CSS help: http://www.w3schools.com/css/
And for PHP this may help:
http://www.w3schools.com/php/
I believe this is what I referred to as “point A” for which I will be spending some quality time.
Thanks!
Hi Alex,
I would setup your homepage using the Thesis settings under the Appearance tab when you are logged in as the Administrator. Get your sidebars, etc. to show how you want using the default toolset.
Then for your categories and pages I would use the tutorial above to setup your page layout templates how you like. As far as learning PHP and CSS… for me it has been years of self-taught trial and error.
My education included programming, but it was FORTRAN, COBOL, PASCAL, and some Machine Language for good measure. I learned principles of programming from taking those classes which help me now, but aside from that its hack and see what sticks.
You can try this link for CSS help: http://www.w3schools.com/css/
And for PHP this may help:
http://www.w3schools.com/php/
Hope this helps.
Hi there, thanks for the post – this is just what I’m looking for but I have no idea what language you’re speaking. Wondering if you can shed some more light on this. I get the feeling I need a “Dummies Guide” to php and css before I throw my laptop out the window.
I need to use the Thesis home page with a 3 column layout (sidebar1, content, sidebar2) and the teasers option. But when a user jumps to a category and a page have a typical blog page (content, sidebar1 (maybe sidebar2 as well)).
I’d like to learn this on my own, can you point me to where I should start reading. I honest think I need a primer. I’ve tried following through the Thesis forum and am lost on most things, the coding is frustrating me.
Suggestions.
Thanks Alex.
Hi MirzaLou,
If what you want is a tutorial on customizing the navigation with drop downs the best tutorial is at Kristarella’s website.
As to your question on where to begin with your customization I think it depends on what your goals are. What things do you want to change?
If you look at the entire scope of changes it may cause you to feel overwhelmed. However, if you tackle each item singularly you will customize your site and learn piece, by piece.
So I would suggest figuring out what you specifically want to do, break it down into specific tasks, then figure out how to complete each of those tasks. It will, no doubt, involve a bit of html, php, and css depending on what you are after.
Let me know if you have any questions.
Hope this helps.
Hi Gregory,
Yes. You would not find any reference on the Thesis website to that function. It’s buried in another part of the theme. I have been on Twitter with Chris Pearson, the Thesis developer, and he was gracious in answering my questions. He directed me to the location of that function.
It is here: ~/themes/thesis/lib/html/sidebars.php
NOTE: If you modify any files outside of the /custom/ directory then you run the risk of not being able to seamlessly update Thesis.
Hope this helps.
I’m new to Thesis and I’m trying to understand all of this. I guess I should ask this in their forum but I like your site so much I wanted to ask you. 🙂
Which tutorial should a beginner start with before trying to understand what you are explaining to do here with custom css and such? If that makes sense? I’ve looked but not sure where the beginning is.
Because Thesis claims less coding, don’t have to be a programmer etc., yet I still just don’t get it.
But I’m having a ball trying to learn! Just not sure how to get to point B since I haven’t been to point A.
For example, I’d like to create drop down menus for my navigational bar across the top or in the sidebar(s).
Thanks!
Hola,
Thank you for the post!
Question: I see you used a function thesis_build_sidebars() but I can’t find any documentation on this on the Thesis site.
hi lawton,
thanks!
you can certainly place only the content from your specific page. I would follow the “press page” example above and then only put the_content() into the page.
Let me know if you have more questions.
Mario and Lisa,
Yes. You will find that the home link will take you back to the root level, in this case index.html instead of index.php.
You will need to create custom navigation to override the home link and change it to index.php. Here is an example:
remove_action('thesis_hook_before_header', 'thesis_nav_menu');
function add_custom_nav () { ?>
[ Put your custom navigation in here ]

add_action('thesis_hook_before_header', 'add_custom_nav');
This will remove the standard nav and replace it with your own, custom defined version.
Hope this helps.
Thanks for the hard work! Is there anyway to strip all of the no sidebar options so it’s just a squeeze page, no, comments or footer?
That works – but yes, the home link goes back to the splash page. I’ll have to link it as you described.
Same here. I’d only like to replace the HTML content in the content area. My concept is to use this as my homepage:
http://www.kingoftheocean.com/index2.html
If we can do that by defining the necessary html in the custom_functions.php and custom.css files, it gives us an easy framework. The question is what hooks to use, and actions to add/remove.
Hi Jen,
You *should* be able to upload your index.html file to the root level via FTP and it will supersede the index.php file from WordPress. WordPress has behaved that way for me in the past. Just ensure you link from your index.html file to http://www.yoursite.com/index.php
Once caveat, the home link inside of WordPress may take users to http://www.yoursite.com and thus they will see the the splash page again. Just be aware of that. You could hard-code the link inside of custom_functions.php.
Hope this helps.
I’m looking to have essentially an HTML splash page that then links to a thesis site.
Hi Mario and Lisa,
To the best of my knowledge you should be able to do that without having to create a separate directory.
The only clarification I need to help me understand what you are asking is when you say:
“I’m looking to create a custom homepage using my own html, and none of Thesis body content.”
Do you mean you want to use no html generated from Thesis AND WordPress?
Or do you mean only the HTML content generated in the content area? (header, sidebar, footer all generated by Thesis/WordPress?)
Hi Amit,
I believe you could use the ‘is_category’ or the ‘in_category’ conditional tags to test and then implement the code you would like. For example:
function new_categorypage() {
if (is_category('5')) { ?>......
In the code above you would substitute your category ID where the number “5” is.
You can find the syntax for category testing here:
http://codex.wordpress.org/Conditional_Tags#A_Category_Page
Let me know if you have any questions.
Hope this helps.
I’ve got the same question as Mario. Thanks
I like this process; really helpful for custom pages I will be creating. However, I’m looking to create a custom homepage using my own html, and none of Thesis body content.
Is this possible by removing actions from various hooks, and adding my custom template as described using the (thesis_hook_before_html)?
Or is it preferred to create a server subdirectory instead for all WordPress pages, and manually link to them from the home.
Just trying to save some code time, without having to copy/paste meta information with future updates.
It is very helpful. Thanks…
How can be category pages customized in the same manner? I need to order post based on custom fields. I have done it on homepage using your tutorial but need to do it on category pages as well?
hi doug,
Once you indicate a custom template and follow the instructions above, you will need to code each different layout, or *look* that you would like and use the right logic to get them to show up on the proper pages.
Hope this helps.
doug
ok, one more question: do I need to copy/paste the entire code from Thesis for each custom page, or does every custom page template already include my current look?
Hi doug,
Yes you do need to create a “home” page and then select it from the drop down menu. What you are seeing now is the default WordPress behavior. Let me know if you have any questions.
Hope this helps.
doug
Ok, but one question. My Reading drop down list doesn’t list “Home” as one of the options as you showed after “Gettin to it” above. Yet, my site definitely has a “Home” link on the nav bar. Should I create a page called “Home”? to use your code above?
The confusing this is that right now, my blog posts all show up on the page called Home, but I never created a page called Home. I guess that is a WP default or something?
rumblepup,
Thanks for the compliment. I think I may do a tut on extra sidebars. You are the second person I have come across who would like to do that. Are you wanting a 3rd sidebar? What kind of sidebar configuration are you after?
Great tutorial. Hooks drive me crazy. What I’ve been trying to do is create additional sidebars, but haven’t had luck so far.
Hi Jen,
Based on what you are describing and the link you sent above I think you can do what you want. You can certainly create a page template and apply it to any specific pages you like.
So it is entirely possible to apply a template to just one page, or to every page but a specific one. You just need to structure your logic correctly.
If you can be more specific I can try to help.
Jen
opps! I probably should have sent the link along! jen11show . com
Jen
This is such a great tutorial! I’ve been playing around with Thesis for a while now and it’s been quite a ride. I just finished my first site using it and looks like your tutorial would have helped immensely – especially since I’m a total novice.
So heres my question (forgive my ignorance!): The first page on the site is a grid system of images which are links to each artists page. I used ‘stack’ to align the images but just found tables yesterday and it seems that might have been the better option? Could I create a table, use the code for a page template, and then use that for the home page thereby keeping the ability to change out images easily?
Thanks again for sharing your work!
best,
Jen
No problem Kathy. I struggled with this code for a while and thought that it might save a few people many hours of frustration. Glad it helps. Let me know if you have any questions.
Great tutorial, timely for me as I am combining my current website with my blog and this helps me no end in how to start to reconfigure things. Thanks again for posting this

Comments are closed.

LAST BIT

bertmahoney.com was made for you by me—Bert—using WordPress with the Semplice theme, a variety of plugins, a sprinkling of custom programming for effect, lots and lots of coffee—actually too much coffee—and 90's hip-hop.

Word.

 

 

More details in the Colophon.

© BERT : MCMXCV — MMXXIIII

Back to top Arrow