on November 6th, 2007How to upgrade your WordPress Theme for WP 2.3?
Post updated to use “Double Quotes” instead of Single Quotes, after realizing single quotes turn to apostrophe and causes the code to break.
I upgraded most of my popular themes to make sure they work with the latest WordPress release 2.3.
For anyone who is starting their blog right now, they can just install the WordPress 2.3 [and some plugins if they are privacy conscious] and start using one of my upgraded themes.
but there are people who have customized the theme so much, that they do not want to upgrade their theme with my latest version.
They want to know what exactly I changed for making theme WordPress 2.3 compatible.
The new feature that is added in the WordPress 2.3 system is the Tags functionality.
Once you upgrade your WordPress installation to 2.3, you would see a text box under the ‘Write Post’ area, for adding “tags” to both new and existing posts. This will let you store the tags along with the posts in the database.
Step 1: Display the Tags under each post’s content
Add the following code somewhere after the call to the_content() or the_excerpt() within “the loop” in index.php, archive.php, search.php and single.php.
<p><?php if (function_exists("the_tags")) the_tags("Tags: ", ", ", "<br/>");?></p>
This code makes sure the function "the_tags()" exists, before calling that. This way the theme will still work on earlier versions of WordPress.
One Important thing to Note:
the_tags() method will only work, when you made a call to the_post() method while initializing the loop.
Some themes still use start_wp() method instead of the_post(). Those themes will not show the Tags at all, even when you made a call to the_tags().
Step 2: Display a Tag Cloud on the Sidebar
If your theme is Sidebar Widgets Compatible and you are using the Sidebar Widgets option, you could easily drag and drop the Tag Cloud Widget [that comes with WordPress 2.3] and be done with it.
If not, you can add the following code somewhere in the sidebar.php file.
<?php if (function_exists("wp_tag_cloud")) { ?>
<li>
<h2><?php _e("Tags"); ?></h2>
<p>
<?php wp_tag_cloud(); ?>
</p>
</li>
<?php } ?>
Again, this code checks for the existence of the method, before calling it, just to make sure the theme works fine in previous versions of WordPress.
I think we have covered two important steps so far.
When someone clicks on one of the Tags, it will lead them to an archive page [WordPress loads the archive.php if found within the theme folder].
So we will just add a heading for the Archive page to let them know they are viewing the archives for that given Tag.
We will open up the archive.php. Usually there will be code that checks if this is an archive for category, or month or day etc.
We will add the following lines to it.
<?php if (function_exists("is_tag")&& is_tag()) { ?>
<h2>Archive for the Tag "<?php echo single_tag_title(); ?>"</h2>
<?php } ?>
This will just add a heading in case someone is viewing your archive by Tags.
Wow. Thats it?
Yeah, and your site is now ready to Rock and Roll with WordPress 2.3.
Disclaimer :
While I made sure the code given here works fine with my themes, there is no guarantee that this will work with your theme without any issues. If you do have an issue, doing it manually, please contact your theme author.
Do not post it as a comment here. Thanks.



[...] WordPress Themes by Sadish » How to upgrade your WordPress Theme for WP 2.3? Wie man die Tag-Funktion von WP 2.3 in sein Theme integriert. (tags: themes WordPress) [...]
[...] 那类过于强大的除外),只是无法支持新的 Tag 系统而已。Sadish 的一篇文章指出了如何通过简单的方法来让现有模板支持 WordPress 2.3 的 Tag [...]
I moderate a romanian blog about yahoo! messenger and i upgrade my wordpress to version 2.3.1. All my post contains diacritics from romanian language (ş ţ î ă â). The upgrade doesn’t recognize them any more and replaced with strange caracters.
http://bogdan.electromania.ro/yahoo/
What can i do?
Hi,
the code works for me with the MistyLook V3.3.1 theme, but there is a caveat:
The PHP code as posted above MUST be edited because it has apostrophes instead of single quotes, and this breaks the theme. If you get a blank page after updating, this is why.
Using an editor with some PHP parser will hint you to the errors (Shameless promotion: I use Jedit with the Sidekick+PHPParser plugins).
Thanks, Sadish, for the article :-)
Thanks rd for reporting back with the issue you found. I changed the code to use double quotes instead of single quotes.
Hope this fixes the issue.
Thanks
Sadish
I am having problems with “I love Music” how do I fix it?
[...] We have updated the Vidiyal theme, so that it will support “Tags” when used with WordPress 2.3. Download the latest version, from the theme page ! If you do not want to get the latest version, but you want to update your version of the theme for Tags feature in WordPress 2.3,check out this article by Sadish, How to upgrade your WordPress Theme for WP 2.3?. [...]
WP 2.31
MistyLook 3.5
Hi Sadish,
If i use several tags (doesnt’ matter if in 1 or several posts), 1 special tag (including a diacritical character) is always displayed with a very large font, the remaining tags are displayed with the normal font. If I use only this special tag at all also this tag is displayed with the normal font.
What can I do?
Thanks for this great theme!
Best regards
Ulli
[...] We have updated the Vidiyal theme, so that it will support “Tags” when used with WordPress 2.3. Download the latest version, from the theme page ! If you do not want to get the latest version, but you want to update your version of the theme for Tags feature in WordPress 2.3,check out this article by Sadish, How to upgrade your WordPress Theme for WP 2.3?. [...]
I am using the MotherNature 1.1 theme. (Thank you.) But I don’t know if it is compatible with WP 2.32 which I installed last night. Is it? Or do I have to get into the code thing? I’m on the brink of breaking things every time I mess with the code – pure trial and error.
你好!邀请您交换友情链接。本站想在首页加入部分友情链接。
请给我留言,谢谢!如果有重复信息请删除!抱歉!
癌症,癌症,
肿瘤医院,肿瘤医院是河北省重点中医肿瘤专科医院。
欢迎交换链接!