One of the things I learned fromΒ creating multiple custom page templates within the Thesis framework was how to create and modify sidebars. WordPress and Thesis provide you with a simple an effective way for implementing sidebars on your website with the use of simple syntax, options, and widgets. (more…)
No, the children pages should not inherit the custom template unless you select the template from the drop-down. Although if you wanted to get crafty, you might be able to write some PHP to do it automatically for you. Hope this helps.
Thanks,
Bert
Kat
The only, I can’t get it work with category pages.
Β Β Β array(
Β Β Β Β Β Β Β ‘name’ => ‘Sidebar Offers’,
Β Β Β Β Β Β Β ‘before_widget’ => ”,
Β Β Β Β Β Β Β ‘after_widget’ => ”,
Β Β Β Β Β Β Β ‘before_title’ => ”,
Β Β Β Β Β Β Β ‘after_title’ => ”
Β Β Β )
);
Β Β Β if ( is_category( ‘ofertas’ )Β ) { ?>
Β Β Β
Β Β Β
Β Β Β Β Β Β
Β Β Β Β Β Β Β Β Β Β
Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β
Β Β Β Β Β Β Β Β Β Β
Β Β Β Β Β Β Β
Β Β Β Β Β Β
remove_action('thesis_hook_custom_template', 'thesis_custom_template_sample');
add_action('thesis_hook_custom_template', 'custom_sidebar_offers');
I hope you can help.
Thanks
Christèle
your conditional statement is using “is_category”
Try using “in_category” to see if that helps.
_Cindy
http://thebodyandsoullifeline.com
Could be your Multimedia box, pretty sure it is.
You can turn that off in Thesis design preferences.
Hope this helps.
-Bert
~Al
Brian
very well written article, can someone tell me how to go about doing this,
I want both sidebars shown on home page but only sidebar 2 on a single post
sidebar 1 – content area – sidebar 2Β
Β Β content area – sidebar 2
width: 217px;
}
float: left;
background-color: yellow;
}
float: left;
background-color: silver;
}
on line 32
If you login via FTP you can open your custom_functions file and take out the offending php.
Hope this helps.
Leigh
if (is_page(64)) { ?>
and so on…
But could you please, please tell me how to state the condition in order to show the custom sidebars if I have WP set to show blog posts instead of a static front page.
/* Custom sidebars */
array(
‘name’ => ‘Sidebar 3’,
‘before_widget’ => ”,
‘after_widget’ => ”,
‘before_title’ => ”,
‘after_title’ => ”
)
);
array(
‘name’ => ‘Sidebar 4’,
‘before_widget’ => ”,
‘after_widget’ => ”,
‘before_title’ => ”,
‘after_title’ => ”
)
);
if (is_page(‘om_brian’) || is_page(‘2′)) { ?>
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', 'custom_sidebar_01');
Fatal error: Call to undefined function sidebar_3() in /home/web81573/domains/brian.se/public_html/wp-content/themes/thesis_16/custom/custom_functions.php on line 59
http://brian.se.linweb58.kontrollpanelen.se/om_brian/
Yes that is the way to go.
if (is_page(‘chateaux’)) { ?>
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', 'custom_sidebar_01');
width: 195px;
}
float: left;
}
float: right;
}
Do you have a URL where I can look at your example? You can email me if you like.
Hope this helps.
Shane
if (is_page(‘places’)) { ?>
remove_action('thesis_hook_custom_template', 'thesis_custom_template_sample');
add_action('thesis_hook_custom_template', 'custom_sidebar_01');
to show an example didn't work :)
<div id "sidebars"
<div class "sidebar"
<ul "sidebar_list"
<php sidebar_whatever();
</ ul
</ div
</ div
Let me know if you have any questions.
Hope this helps.
When I just visited your website I see the sidebars. However I am using Google Chrome. π
Have you fixed it?
Thanks in advance for whatever help you can provide….
There are 2 ways to go about this. Simplest would be to copy down whatever widgets/customization you have in sidebar #1 and mirror that in sidebar #2. Then create a new sidebar #1 with whatever widgets you would like. Then in Thesis layout you could order your layout:
Hope this helps.
You would follow the above code for the custom page template but do not call the sidebars at all. Depending on how you want the page width handed, etc. you would control that in you custom.css file. Hope this helps.
If I understand your comment #2 correctly you are not calling the sidebar?
How are you calling sidebar 3?
This one will come in handy for a project I’m working on – thanks Bert!
But i have a problem when i tried it. Maybe because i don't talk enough in english i don't know.
i have this error message : Fatal error: Call to undefined function sidebar_4() in custom_functions.php on line 185…
can you help me ?
I have a tutorial coming up soon that will show you how to achieve 4 different page layouts using a 3 column standard Thesis display and about a dozen lines of CSS code. Hope to post soon. I think it will either provide you with an answer or give you inspiration. Hope this helps.
Thanks for your anticipated response π
ak
custom_widget_02;
Depending on the gradient you will want it to repeat vertically or horizontally so CSS accordingly.
Hope this helps.
<?php dynamic_sidebar(sidebar_3); ?>
<?php thesis_sidebar_1(); ?>
</div>
function sidebar_3() { ?>
<ul class=”sidebar_list”>
<?php thesis_default_widget(3); ?>
</ul>
</div>
function sidebar_4() { ?>
<ul class=”sidebar_list”>
<?php thesis_default_widget(4); ?>
</ul>
</div>
<div id=”show-only-3-and-1″>
<?php dynamic_sidebar(sidebar_3); ?>
<?php thesis_sidebar_1(); ?>
</div>
<?php sidebar_3(); ?>
<?php sidebar_4(); ?>
</div>
i'm trying to make my homepage have 3 columns instead of 2 columns. so i opted for your custom page template design. now i have a problem customizing my custom page template. what do you think is the best option for me now? am i overcomplicating things?
The netherlands
I need to disable sidebars from the home page only. Is there any custom hook we can use to disable sidebars.
You show here that Thesis Theme allows to create multiple sidebars and assign sidebars to post/category/page .
You need to build some custom sidebars then build a custom page
template that uses those custom sidebars. You can see how to do the
custom page tutorial on my site here:
I would check the names of each of your functions and calls to them.
Typically there is something not matching properly when you see these
errors.
Hope this helps.
I know that this is possible to do with static pages, but is it possible to do this on category pages. I have some premade templates for wordpress, blogger, etc. that I sell, I am currently on blogspot transferring over to WordPress and have deciced upon thesis. However, I am a complete nin-com-poop when it comes to this whole hook thing. I would like some sidebars to have certain widgets displayed on certain category pages??? possible, no?
array(
'name'=>'Sidebar 3',
'before_widget'=>'<li class=”widget %2$s” id=”%1$s”>',
'after_widget'=>'</li>',
'before_title'=>'<h3>',
'after_title'=>'</h3>'
)
);
/* TEST FOR SPECIFIC PAGE FOR SIDEBAR TUTORIAL */
if (is_page('test')) { ?>
<div id=”content”>
<div class=”post_box”>
<div class=”headline_area”>
<?php the_title('<h1>', '</h1>'); ?>
</div>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div class=”format_text”>
<?php the_content( ); ?>
</div>
<?php endwhile; ?>
<?php else : ?>
<h2>Not Found</h2>
<?php endif; ?>
</div>
</div>
<div id=”sidebars”>
<div id=”show-only-3-and-4″>
<?php sidebar_3(); ?>
<?php sidebar_4(); ?>
</div>
</div>
<?php } }
remove_action('thesis_hook_custom_template', 'thesis_custom_template_sample');
add_action('thesis_hook_custom_template', 'custom_sidebar_01');
No problem.
There are spaces between the < and the > of all the tags. This is so
the website does not 'process' them and make them disappear.
What part do i have to remove?
I cannot see all the code you posted. Perhpaps it was stripped out in
posting.
Here is the code you need. I have put spaced in the tags so that the
code stays in tact. Be sure to remove them:
array(
'name' => 'Sidebar 3',
'before_widget' => '< li class=”widget %2$s” id=”%1$s” >',
'after_widget' => '< / li >',
'before_title' => '< h3 >',
'after_title' => '< / h3 >'
)
);
register_sidebars(1,
array(
'name' => 'Sidebar 3',
'before_widget' => '<li class=”widget %2$s” id=”%1$s”>',
'after_widget' => '</li>',
'before_title' => '<h3>',
'after_title' => '</h3>'
)
);
The link is http://www.mikevsnet.be/?page_id=146
or
content, column, column, etc.
that one line of css will do the trick depending on your layout).
Let me know if you have any questions.
– use thesis to calculate and render the 3 columns. Copy the CSS code.
– use thesis to settle on the 2 column layout
– use open-hook to add a wrapper around the content so CSS knows it is the homepage, and tweak the css for the homepage “exception”.
Jayson
On my “pages” I wanted a three column layout, with subnavigation on a sidebar to the left of the content column.
if (is_page()) {
echo ' <div id=”column_wrap”>';
thesis_content_column();
thesis_get_sidebar(2);
echo ' </div>';
thesis_hook_before_sidebars();
if (thesis_show_multimedia_box())
thesis_multimedia_box();
echo ' </div>';
} }
thesis_wrap_columns() in lib/content_box.php
thesis_sidebars in lib/sidebars.php
thesis_build_sidebars in lib/sidebars.php
.custom #column_wrap { width: 74.1em;}
dynamic_sidebar('Sidebar 3');
or
dynamic_sidebar(3);
This outputs something, but does not “load” the sidebar with the defined widgets..
If you look above you define the sidebar in custom_functions.php ( I have spaced out some tags so they will show):
array(
'name' => 'Sidebar 3',
'before_widget' => '< li class=”widget %2$s” id=”%1$s” >',
'after_widget' => '< / li >',
'before_title' => '< h3 >',
'after_title' => '< / h3 >'
)
);
Let me know if you have any questions.
Hope this helps.
You show here that Thesis Theme allows to create multiple sidebars and assign sidebars to post/category/page .
You need to build some custom sidebars then build a custom page
template that uses those custom sidebars. You can see how to do the
custom page tutorial on my site here:
I made the changes but when i try do change it again it shows the previous boxes only here is my code
//
if (get_option(βtt_ad_one_imgβ)) {} else { add_option(βtt_ad_one_imgβ, βad1.gifβ); }
if (get_option(βtt_ad_two_imgβ)) {} else { add_option(βtt_ad_two_imgβ, βad2.gifβ); }
if (get_option(βtt_ad_three_imgβ)) {} else { add_option(βtt_ad_three_imgβ, βad3.gifβ); }
if (get_option(βtt_ad_four_imgβ)) {} else { add_option(βtt_ad_four_imgβ, βad4.gifβ); }
if (get_option(βtt_footer_optβ)) {} else { add_option(βtt_footer_optβ, βfalseβ); }
if (get_option(βtt_ad_one_urlβ)) {} else { add_option(βtt_ad_two_urlβ, βlink for second imageβ); }
$tt_a1_url = get_option(βtt_ad_one_urlβ);
$tt_a2_url = get_option(βtt_ad_two_urlβ);
$tt_a3_url = get_option(βtt_ad_three_urlβ);
$tt_a4_url = get_option(βtt_ad_four_urlβ);
// END OF CUSTOM VARIABLES
//
<div id=”show-only-3-and-4″>
<?php sidebar_3(); ?>
<?php sidebar_4(); ?>
</div>
</div>
I would check the names of each of your functions and calls to them.
Typically there is something not matching properly when you see these
errors.
Hope this helps.
I know that this is possible to do with static pages, but is it possible to do this on category pages. I have some premade templates for wordpress, blogger, etc. that I sell, I am currently on blogspot transferring over to WordPress and have deciced upon thesis. However, I am a complete nin-com-poop when it comes to this whole hook thing. I would like some sidebars to have certain widgets displayed on certain category pages??? possible, no?
array(
'name'=>'Sidebar 3',
'before_widget'=>'<li class=”widget %2$s” id=”%1$s”>',
'after_widget'=>'</li>',
'before_title'=>'<h3>',
'after_title'=>'</h3>'
)
);
/* TEST FOR SPECIFIC PAGE FOR SIDEBAR TUTORIAL */
if (is_page('test')) { ?>
<div id=”content”>
<div class=”post_box”>
<div class=”headline_area”>
<?php the_title('<h1>', '</h1>'); ?>
</div>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div class=”format_text”>
<?php the_content( ); ?>
</div>
<?php endwhile; ?>
<?php else : ?>
<h2>Not Found</h2>
<?php endif; ?>
</div>
</div>
<div id=”sidebars”>
<div id=”show-only-3-and-4″>
<?php sidebar_3(); ?>
<?php sidebar_4(); ?>
</div>
</div>
<?php } }
remove_action('thesis_hook_custom_template', 'thesis_custom_template_sample');
add_action('thesis_hook_custom_template', 'custom_sidebar_01');
No problem.
There are spaces between the < and the > of all the tags. This is so
the website does not 'process' them and make them disappear.
What part do i have to remove?
I cannot see all the code you posted. Perhpaps it was stripped out in
posting.
Here is the code you need. I have put spaced in the tags so that the
code stays in tact. Be sure to remove them:
array(
'name' => 'Sidebar 3',
'before_widget' => '< li class=”widget %2$s” id=”%1$s” >',
'after_widget' => '< / li >',
'before_title' => '< h3 >',
'after_title' => '< / h3 >'
)
);
register_sidebars(1,
array(
'name' => 'Sidebar 3',
'before_widget' => '<li class=”widget %2$s” id=”%1$s”>',
'after_widget' => '</li>',
'before_title' => '<h3>',
'after_title' => '</h3>'
)
);
The link is http://www.mikevsnet.be/?page_id=146
or
content, column, column, etc.
that one line of css will do the trick depending on your layout).
Let me know if you have any questions.
– use thesis to calculate and render the 3 columns. Copy the CSS code.
– use thesis to settle on the 2 column layout
– use open-hook to add a wrapper around the content so CSS knows it is the homepage, and tweak the css for the homepage “exception”.
Jayson
On my “pages” I wanted a three column layout, with subnavigation on a sidebar to the left of the content column.
if (is_page()) {
echo ' <div id=”column_wrap”>';
thesis_content_column();
thesis_get_sidebar(2);
echo ' </div>';
thesis_hook_before_sidebars();
if (thesis_show_multimedia_box())
thesis_multimedia_box();
echo ' </div>';
} }
thesis_wrap_columns() in lib/content_box.php
thesis_sidebars in lib/sidebars.php
thesis_build_sidebars in lib/sidebars.php
.custom #column_wrap { width: 74.1em;}
dynamic_sidebar('Sidebar 3');
or
dynamic_sidebar(3);
This outputs something, but does not “load” the sidebar with the defined widgets..
If you look above you define the sidebar in custom_functions.php ( I have spaced out some tags so they will show):
array(
'name' => 'Sidebar 3',
'before_widget' => '< li class=”widget %2$s” id=”%1$s” >',
'after_widget' => '< / li >',
'before_title' => '< h3 >',
'after_title' => '< / h3 >'
)
);
Let me know if you have any questions.
Hope this helps.
I would check the names of each of your functions and calls to them.
Typically there is something not matching properly when you see these
errors.
Hope this helps.
I would check the names of each of your functions and calls to them.
Typically there is something not matching properly when you see these
errors.
Hope this helps.
I know that this is possible to do with static pages, but is it possible to do this on category pages. I have some premade templates for wordpress, blogger, etc. that I sell, I am currently on blogspot transferring over to WordPress and have deciced upon thesis. However, I am a complete nin-com-poop when it comes to this whole hook thing. I would like some sidebars to have certain widgets displayed on certain category pages??? possible, no?
array(
'name'=>'Sidebar 3',
'before_widget'=>'<li class=”widget %2$s” id=”%1$s”>',
'after_widget'=>'</li>',
'before_title'=>'<h3>',
'after_title'=>'</h3>'
)
);
/* TEST FOR SPECIFIC PAGE FOR SIDEBAR TUTORIAL */
if (is_page('test')) { ?>
<div id=”content”>
<div class=”post_box”>
<div class=”headline_area”>
<?php the_title('<h1>', '</h1>'); ?>
</div>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div class=”format_text”>
<?php the_content( ); ?>
</div>
<?php endwhile; ?>
<?php else : ?>
<h2>Not Found</h2>
<?php endif; ?>
</div>
</div>
<div id=”sidebars”>
<div id=”show-only-3-and-4″>
<?php sidebar_3(); ?>
<?php sidebar_4(); ?>
</div>
</div>
<?php } }
remove_action('thesis_hook_custom_template', 'thesis_custom_template_sample');
add_action('thesis_hook_custom_template', 'custom_sidebar_01');
No problem.
There are spaces between the < and the > of all the tags. This is so
the website does not 'process' them and make them disappear.
What part do i have to remove?
I cannot see all the code you posted. Perhpaps it was stripped out in
posting.
Here is the code you need. I have put spaced in the tags so that the
code stays in tact. Be sure to remove them:
array(
'name' => 'Sidebar 3',
'before_widget' => '< li class=”widget %2$s” id=”%1$s” >',
'after_widget' => '< / li >',
'before_title' => '< h3 >',
'after_title' => '< / h3 >'
)
);
register_sidebars(1,
array(
'name' => 'Sidebar 3',
'before_widget' => '<li class=”widget %2$s” id=”%1$s”>',
'after_widget' => '</li>',
'before_title' => '<h3>',
'after_title' => '</h3>'
)
);
The link is http://www.mikevsnet.be/?page_id=146
or
content, column, column, etc.
that one line of css will do the trick depending on your layout).
Let me know if you have any questions.
or
content, column, column, etc.
that one line of css will do the trick depending on your layout).
Let me know if you have any questions.
or
content, column, column, etc.
that one line of css will do the trick depending on your layout).
Let me know if you have any questions.
or
content, column, column, etc.
that one line of css will do the trick depending on your layout).
Let me know if you have any questions.
– use thesis to calculate and render the 3 columns. Copy the CSS code.
– use thesis to settle on the 2 column layout
– use open-hook to add a wrapper around the content so CSS knows it is the homepage, and tweak the css for the homepage “exception”.
Jayson
On my “pages” I wanted a three column layout, with subnavigation on a sidebar to the left of the content column.
if (is_page()) {
echo ' <div id=”column_wrap”>';
thesis_content_column();
thesis_get_sidebar(2);
echo ' </div>';
thesis_hook_before_sidebars();
if (thesis_show_multimedia_box())
thesis_multimedia_box();
echo ' </div>';
} }
thesis_wrap_columns() in lib/content_box.php
thesis_sidebars in lib/sidebars.php
thesis_build_sidebars in lib/sidebars.php
.custom #column_wrap { width: 74.1em;}
dynamic_sidebar('Sidebar 3');
or
dynamic_sidebar(3);
This outputs something, but does not “load” the sidebar with the defined widgets..
If you look above you define the sidebar in custom_functions.php ( I have spaced out some tags so they will show):
array(
'name' => 'Sidebar 3',
'before_widget' => '< li class=”widget %2$s” id=”%1$s” >',
'after_widget' => '< / li >',
'before_title' => '< h3 >',
'after_title' => '< / h3 >'
)
);
Let me know if you have any questions.
Hope this helps.
the php code you tried to post did not show.
If you put spaces between the ? and php it should post fine. Try that
then I can take a look.
the php code you tried to post did not show.
If you put spaces between the ? and php it should post fine. Try that
then I can take a look.
Yes that is the way to go.
if (is_page(‘chateaux’)) { ?>
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', 'custom_sidebar_01');
width: 195px;
}
float: left;
}
float: right;
}
Do you have a URL where I can look at your example? You can email me if you like.
Hope this helps.
Shane
if (is_page(‘places’)) { ?>
remove_action('thesis_hook_custom_template', 'thesis_custom_template_sample');
add_action('thesis_hook_custom_template', 'custom_sidebar_01');
to show an example didn't work :)
<div id "sidebars"
<div class "sidebar"
<ul "sidebar_list"
<php sidebar_whatever();
</ ul
</ div
</ div
Let me know if you have any questions.
Hope this helps.
When I just visited your website I see the sidebars. However I am using Google Chrome. π
Have you fixed it?
Thanks in advance for whatever help you can provide….
There are 2 ways to go about this. Simplest would be to copy down whatever widgets/customization you have in sidebar #1 and mirror that in sidebar #2. Then create a new sidebar #1 with whatever widgets you would like. Then in Thesis layout you could order your layout:
Hope this helps.
You would follow the above code for the custom page template but do not call the sidebars at all. Depending on how you want the page width handed, etc. you would control that in you custom.css file. Hope this helps.
If I understand your comment #2 correctly you are not calling the sidebar?
How are you calling sidebar 3?
This one will come in handy for a project I’m working on – thanks Bert!
Comments are closed.