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/
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:
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!):
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
- create a unique function name
- reference the right page in the conditional
- make sure conditional is within the function
- place whatever content you would like within the proper divs
- style the content within the custom.css file
- make sure your page within WordPress has the custom template selected as its template option
- 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.
Bert
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?
Glad that you figured it out.
Thanks,
Bert
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
Joshua
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 ?
Steve
if (is_page(‘videos’) || is_page(’11’)) { ?>
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.
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()).
==
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.
if (is_page(‘another’) || is_page(‘134343’)) { ?>
remove_action('thesis_hook_custom_template','thesis_custom_template_sample');
add_action('thesis_hook_custom_template', 'another_page');
function home_pagecustom() {
if (is_home() || is_front_page()) { ?>
Sorry, but you are looking for something that isn’t here.
remove_action('thesis_hook_custom_template', 'thesis_custom_template_sample');
add_action('thesis_hook_custom_template', 'home_pagecustom');
home_pagecustom{width:820px;}
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.
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.
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.
If what you want is to list just the excerpts of your posts you should refer to excerpt basics here: http://bit.ly/19mirP
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.
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.
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.
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
if (is_home() || is_front_page()) {
?>
Sorry, but you are looking for something that isn't here.
Hope this helps.
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
Thanks. I should have the sidebar tutorial online by end-of-day Monday (hopefully sooner if possible). Stay tuned.
Cheers,
berchman
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.
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/
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 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.
Question 2, Is there an alternate way of finding a page’s ID? Besides opening up the DB and finding it there, of course(~:
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.
http://www.w3schools.com/php/
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.
http://www.w3schools.com/php/
Hope this helps.
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.
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!
Thank you for the post!
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.
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.
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');
Hope this helps.
http://www.kingoftheocean.com/index2.html
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
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')) { ?>......
http://codex.wordpress.org/Conditional_Tags#A_Category_Page
Hope this helps.
Is this possible by removing actions from various hooks, and adding my custom template as described using the (thesis_hook_before_html)?
Just trying to save some code time, without having to copy/paste meta information with future updates.
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.
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.
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?
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.
Thanks
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 am also looking to use custom templates on posts. Were you able to find a way to get this done ?
Vishal
Thanks!
Thanks!
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.
/* check to see if homepage. has to happen inside the function */
if (is_home() || is_front_page()) {
?>
if (is_home() || is_front_page()) {
?>
HOmepage HTML here
<?php }
else {
?> Alterntave HTML code here
<?php }
}
…Your Custom homepage layout goes here…
<?php } }
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.
The site is at http://www.PartnersForHousing.com
“?
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.
…Your custom layout goes here…
<?php } }
…Your custom layout goes here…
<?php } }
You need to click on the “Edit” button, not the “Quick Edit” button.
Hope this helps.
You would need to build a custom template to handle this based on what
type of page you are trying to display.
category pages, and then deliver the right custom page template.
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?
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.
http://berchman.com/thesis-tutorial-multipl…
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 } }
add_action('thesis_hook_custom_template', 'custom_page_template');
thanks for the great tutorial!
I tried to implement that stuff but got stuck.
I'd like the home page to use sidebar 2.
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>
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
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.
.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?
Carey
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?
if(is_video()) { ?>
<?php if (function_exists(“vimeorss”)) { vimeorss(“myfeed”, “videos”, 10, “”, “”, 760, “medium”); } ?>
}
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.
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.
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.
I mean for example home page with widget pages, and newsletter page with only the list with different post in it?
But the problem now is that i have to do it in a custom template, for example the first page.
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.
If i use display:none; for the sidebars it gives an empty field and the text of content doesn't expand in that.
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.
Glad you got things sorted out. Stay tuned. More tutorials to come.
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 ;).
if (is_page('blank') || is_page('2333')) { ?>
<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>
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
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-…
Bert
You need to click on the “Edit” button, not the “Quick Edit” button.
Hope this helps.
You would need to build a custom template to handle this based on what
type of page you are trying to display.
category pages, and then deliver the right custom page template.
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?
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.
http://berchman.com/thesis-tutorial-multipl…
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 } }
add_action('thesis_hook_custom_template', 'custom_page_template');
thanks for the great tutorial!
I tried to implement that stuff but got stuck.
I'd like the home page to use sidebar 2.
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>
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
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.
.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?
Carey
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?
if(is_video()) { ?>
<?php if (function_exists(“vimeorss”)) { vimeorss(“myfeed”, “videos”, 10, “”, “”, 760, “medium”); } ?>
}
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.
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.
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.
I mean for example home page with widget pages, and newsletter page with only the list with different post in it?
But the problem now is that i have to do it in a custom template, for example the first page.
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.
If i use display:none; for the sidebars it gives an empty field and the text of content doesn't expand in that.
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.
Glad you got things sorted out. Stay tuned. More tutorials to come.
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 ;).
if (is_page('blank') || is_page('2333')) { ?>
<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>
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
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-…
Bert
You need to click on the “Edit” button, not the “Quick Edit” button.
Hope this helps.
You would need to build a custom template to handle this based on what
type of page you are trying to display.
category pages, and then deliver the right custom page template.
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?
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.
http://berchman.com/thesis-tutorial-multipl…
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 } }
add_action('thesis_hook_custom_template', 'custom_page_template');
thanks for the great tutorial!
I tried to implement that stuff but got stuck.
I'd like the home page to use sidebar 2.
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>
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
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.
.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?
Carey
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?
if(is_video()) { ?>
<?php if (function_exists(“vimeorss”)) { vimeorss(“myfeed”, “videos”, 10, “”, “”, 760, “medium”); } ?>
}
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.
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.
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.
I mean for example home page with widget pages, and newsletter page with only the list with different post in it?
But the problem now is that i have to do it in a custom template, for example the first page.
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.
If i use display:none; for the sidebars it gives an empty field and the text of content doesn't expand in that.
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.
Glad you got things sorted out. Stay tuned. More tutorials to come.
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 ;).
if (is_page('blank') || is_page('2333')) { ?>
<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>
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
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-…
Bert
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?
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.
http://berchman.com/thesis-tutorial-multipl…
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 } }
add_action('thesis_hook_custom_template', 'custom_page_template');
thanks for the great tutorial!
I tried to implement that stuff but got stuck.
I'd like the home page to use sidebar 2.
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>
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
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.
.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?
Carey
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?
if(is_video()) { ?>
<?php if (function_exists(“vimeorss”)) { vimeorss(“myfeed”, “videos”, 10, “”, “”, 760, “medium”); } ?>
}
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.
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.
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.
I mean for example home page with widget pages, and newsletter page with only the list with different post in it?
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-…
Bert
But the problem now is that i have to do it in a custom template, for example the first page.
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.
If i use display:none; for the sidebars it gives an empty field and the text of content doesn't expand in that.
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.
Glad you got things sorted out.
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 ;).
if (is_page('blank') || is_page('2333')) { ?>
<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>
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
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.
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()).
==
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.
if (is_page(‘another’) || is_page(‘134343’)) { ?>
remove_action('thesis_hook_custom_template','thesis_custom_template_sample');
add_action('thesis_hook_custom_template', 'another_page');
function home_pagecustom() {
if (is_home() || is_front_page()) { ?>
Sorry, but you are looking for something that isn’t here.
remove_action('thesis_hook_custom_template', 'thesis_custom_template_sample');
add_action('thesis_hook_custom_template', 'home_pagecustom');
home_pagecustom{width:820px;}
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.
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.
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.
If what you want is to list just the excerpts of your posts you should refer to excerpt basics here: http://bit.ly/19mirP
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.
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.
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.
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
Hope this helps.
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
Thanks. I should have the sidebar tutorial online by end-of-day Monday (hopefully sooner if possible). Stay tuned.
Cheers,
berchman
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.
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/
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 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.
Question 2, Is there an alternate way of finding a page’s ID? Besides opening up the DB and finding it there, of course(~:
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.
http://www.w3schools.com/php/
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.
http://www.w3schools.com/php/
Hope this helps.
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.
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!
Thank you for the post!
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.
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.
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');
Hope this helps.
http://www.kingoftheocean.com/index2.html
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
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')) { ?>......
http://codex.wordpress.org/Conditional_Tags#A_Category_Page
Hope this helps.
Is this possible by removing actions from various hooks, and adding my custom template as described using the (thesis_hook_before_html)?
Just trying to save some code time, without having to copy/paste meta information with future updates.
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.
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.
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?
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.
Comments are closed.