Thanks to the always impressive Chris Gossmann we inch ever closer to Thematic version 1. Put your upgrade hats on and check out Thematic 0.9.6.1 As always you can download the latest version of Thematic from WordPress.org.
What’s new in Thematic 0.9.6.1
-
Added two new hooks:
thematic_abovecontainer()
thematic_belowcontainer()
-
Thematic prevents the creation of the WordPress Generator. This can be filtered using a filter for
thematic_hide_generators
. ReturnTRUE
and the WordPress Generator will be created. -
Added some filters to
comments.php
:- The standard text ‘One Comment’ can be filtered using
thematic_singlecomment_text
. - The standard text ‘n Comments’ can be filtered using
thematic_multiplecomments_text
. - The standard text ‘Post a Comment’ can be filtered using
thematic_postcomment_text
. - The standard text ‘Post a Reply to %s’ can be filtered using
thematic_postreply_text
. - The standard text ‘Comment’ for the text box can be filtered using
thematic_commentbox_text
. - The standard text ‘Post Comment’ for the send button can be filtered using
thematic_commentbutton_text
.
- The standard text ‘One Comment’ can be filtered using
-
Split up
thematic_postheader()
andthematic_postfooter()
into sub-functions. With these new functions it is easier to rearrange the displayed data.thematic_postheader()
thematic_postheader_posttitle()
thematic_postheader_postmeta()
thematic_postmeta_authorlink()
thematic_postmeta_entrydate()
thematic_postmeta_editlink()
thematic_postfooter()
thematic_postfooter_posteditlink()
thematic_postfooter_postcategory()
thematic_postfooter_posttags()
thematic_postfooter_postconnect()
thematic_postfooter_postcomments()
-
The several parts of the body class can be switched off using the following filters:
thematic_show_bodyclass
(master switch)thematic_show_bc_wordpress
thematic_show_bc_datetime
thematic_show_bc_contenttype
thematic_show_bc_singular
thematic_show_bc_singlepost
thematic_show_bc_authorarchives
thematic_show_bc_categoryarchives
thematic_show_bc_tagarchives
thematic_show_bc_pages
thematic_show_bc_search
thematic_show_bc_loggedin
thematic_show_bc_browser
-
<head profile="http://gmpg.org/xfn/11">
can be filtered usingthematic_head_profile
. -
Complete rewrite of the widget areas:
The widget areas are now controlled by the
$thematic_widgetized_areas
array. This is the basic layout:$thematic_widgetized_areas = array( 'Primary Aside' =>; array( 'admin_menu_order' => 100, 'args' => array ( 'name' => 'Primary Aside', 'id' => 'primary-aside', 'description' => __('The primary widget area, most often used as a sidebar.', 'thematic'), 'before_widget' => thematic_before_widget(), 'after_widget' => thematic_after_widget(), 'before_title' => thematic_before_title(), 'after_title' => thematic_after_title(), ), 'action_hook' => 'widget_area_primary_aside', 'function' => 'thematic_primary_aside', 'priority' => 10, ), )
Using this array you can remove unnecessary widget areas with a filter before these are created:
function remove_widget_area($content) { unset($content['Primary Aside']); return $content; } add_filter('thematic_widgetized_areas', 'remove_widget_area');
Note: This will completely remove a widget area. Do not use this functionality with conditional tags to remove a widget area from a certain page / post.
A widget area can be renamed:
function rename_widget_area($content) { $content['Primary Aside']['args']['name'] = 'My first Sidebar'; return $content; } add_filter('thematic_widgetized_areas', 'rename_widget_area');
Display a widget area based on a conditional tag:
// First we create a new function to display the secondary aside only on pages: function childtheme_secondary_aside() { if (is_page()) { if (is_sidebar_active('secondary-aside')) { echo thematic_before_widget_area('secondary-aside'); dynamic_sidebar('secondary-aside'); echo thematic_after_widget_area('secondary-aside'); } } } // ... and then ... without removing an action or so: function change_secondary_aside($content) { $content['Secondary Aside']['function'] = 'childtheme_secondary_aside'; return $content; } add_filter('thematic_widgetized_areas','change_secondary_aside');
Create several widget areas that will be displayed on a certain position based on conditional tags:
function change_secondary_aside($content) { $content['Secondary Aside']['function'] = 'childtheme_secondary_aside'; $content['Secondary Aside Pages'] = array( 'admin_menu_order' => 201, 'args' => array ( 'name' => 'Secondary Aside Pages', 'id' => 'secondary-aside-pages', 'description' => __('The secondary widget area for pages.', 'childtheme'), 'before_widget' => thematic_before_widget(), 'after_widget' => thematic_after_widget(), 'before_title' => thematic_before_title(), 'after_title' => thematic_after_title(), ), 'action_hook' => 'thematic_secondary_aside', 'function' => 'childtheme_secondary_aside', 'priority' => 10, ); return $content; } add_filter('thematic_widgetized_areas','change_secondary_aside'); function childtheme_secondary_aside() { if (is_sidebar_active('secondary-aside') && is_sidebar_active('secondary-aside-pages')) { echo thematic_before_widget_area('secondary-aside'); if (is_page()) { dynamic_sidebar('secondary-aside-pages'); } else { dynamic_sidebar('secondary-aside'); } echo thematic_after_widget_area('secondary-aside'); } }
-
Fixed:
- Fixed a bug in
thematic_page_title()
not displaying a correct title in attachement.php - Fixed the widget area ‘Index Insert’.
- Fixed a bug in
thematic_create_robots()
.
- Fixed a bug in
*is happy*
I was looking forward to some of these from the forums, and was positively surprised by the rest. :3
How fortuitous! I was working on a child theme today and wishing I had
thematic_abovecontainer()</code and
thematic_belowcontainer()
. Boom, here it is. Thanks!Awesome!
I’ll be using this on new projects, but what’s the recommendation for existing sites using older versions of thematic? Is upgrading likely to break anything?
Hi Mark,
the new version shouldn’t break the older child themes as long as these use the drop down menus. Everything based on the classic theme needs a bit modification.
Btw., the next version needs WP >= 2.8.x
Chris
Thanks Chris. What’s the issue with the menus? All the child themes in question are ones I’ve written myself and I normally write my own menu generator functions.
The classic theme used wp_list_pages(). The newer versions are using wp_page_menu() with the Superfish jQuery. If you use your own menu generator functions for your child themes, all of them will work with the latest release.
Chris
Thanks for clarifying.
Looking forward to trying it out!
Great work Ian and Chris!
I haven’t taken the new version out for a test drive yet, but look forward to very soon.
I’m really looking forward to using the thematic_postheader() and thematic_postfooter(). Also psyched about the body class filters. No more unnecessary classes.
Thanks again guys.
Good work, as always. Thematic is the most time saving product ever, at least for me. Thanks Ian, thanks Chris!
thanks for the great theme framework, I am going to use the new version for my next project. I just love it.
Will this work with WP 3.0 beta as it is?
Mike,
it will work with WP 3.0 as it is. The new menu won’t work out-of-the-box.
Chris
I want to use the code so the secondary aside appears on pages (and not the “main” index page). I’m completely clueless as to where you place the code listed here. Thanks!
One approach is to hide the secondary aside using CSS. You could add this function to the function.php file of your child theme:
function childtheme_head_styles() {
if( !is_page() ) { ?>
#secondary {
display: none;
}
<?php }
}
add_action('thematic_head_scripts','childtheme_head_styles',9);
The widgets still load, but the entire aside is hidden.
Dennis
I still can’t seem to get that to work either. Here is my problem: The primary aside is basically “covered” by the secondary aside. If there isn’t enough content on a page, it cuts off the widgets I’ve added to the primary aside.
The secondary aside is actually located at the bottom left of the page. When I add a text widget to the secondary aside and use and to create blank lines, it fixes the primary aside on the pages without a lot of content; however – on the main page, I have a huge space between the content and the footer.
A friend of mind had someone design this site using thematic; he saw the problems and knew I had WordPress experience and asked me to check it out. However, I have never used thematic and am completely stumped. Any suggestions would be great.
Best theme ever. I love it.
Question directed to anyone: I am using a Thematic child theme which has disabled the display of a menu, but I would like to change it so I have that menu. (I have been using a sidebar menu for now, but would really like a normal menu somewhere across the top.) Do I need to delete/add some css code in order to achieve this? How do I go about figuring out what to do?
I appreciate the help!
Can Thematic be used on a commercial blog? I couldn’t find a clear answer to this question.