-
Website
http://www.berchman.com/ -
Original page
http://www.berchman.com/thesis-tutorial-multiple-custom-page-templates/ -
Subscribe
All Comments -
Community
-
Top Commenters
-
Cecily Walker
1 comment · 5 points
-
shanearthur
2 comments · 1 points
-
Alan Mairson
2 comments · 2 points
-
Kate Foy
1 comment · 1 points
-
berchman
52 comments · 1 points
-
-
Popular Threads
-
Information Graphic Brilliance
1 week ago · 1 comment
-
Information Graphic Brilliance
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
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.
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?
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?
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.
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.
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?
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.
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_C...
Let me know if you have any questions.
Hope this helps.
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?)
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.
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.
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!
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.
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.
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!
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.
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.
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.
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.
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!
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...
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.
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(~:
Here is a plugin to display it though, and it works well for me.
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.
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. ")
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.
Thanks!
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.
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
Thanks. I should have the sidebar tutorial online by end-of-day Monday (hopefully sooner if possible). Stay tuned.
Cheers,
berchman
Thanks,
Nicky
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.
Thank you!
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://www.berchman.com/hire-a-specialist-that-...
and we can get things started.
Best regards,
Bert
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!
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
<pre>
function home_pagecustom() {
if (is_home() || is_front_page()) {
?>
<div id="home_top_message">
<?php if (have_posts()) : ??>
<?php while (have_posts()) : the_post(); ??>
</div><div id="home_message">
<?php the_content( ); ??>
</div>
<?php endwhile; ??>
<?php else : ??>
<h2>Not Found</h2>
Sorry, but you are looking for something that isn't here.
<?php include (TEMPLATEPATH . "/searchform.php"); ??>
<?php endif; ??>
</pre>
Let me know if you have any questions.
Hope this helps.
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.
Regards,
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.
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.
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.
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 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 : )
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.
Thanks / Marcus
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.
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.
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.
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!
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, 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.
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.
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.
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
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');
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
Glad you got things sorted out. Stay tuned. More tutorials to come.
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.
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
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.
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 ;)
I found it! With inline style i changed the width too 100%! and that worked...
I love it
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
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.
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
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.
Let's say my page on my site is 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?
I am new to Thesis and have my first site 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
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.
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
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
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!
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
http://www.berchman.com/thesis-tutorial-multipl...
Thanks again for the great tutorial. I have bookmarked your site and will be checking out your other articles.
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.
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
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.
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.
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.
You need to click on the "Edit" button, not the "Quick Edit" button.
Hope this helps.
?>
...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!
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.
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!!