DIY Themes Forums  

Go Back   DIY Themes Forums > Thesis Theme > Thesis Customization Tips
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-19-2008, 06:30 PM
Junior Member
 
Join Date: Aug 2008
Location: Haarlem, the Netherlands
Posts: 8
Default Show category in my posts

I use several category's on my weblog. I would like in each article to see not only the authors name and date/time but also the category in which the specific article was written. How can I do that?
Reply With Quote
  #2 (permalink)  
Old 08-19-2008, 11:46 PM
Senior Member
 
Join Date: Jul 2008
Location: Connersville, IN
Posts: 2,244
Send a message via ICQ to kingdomgeek Send a message via AIM to kingdomgeek Send a message via MSN to kingdomgeek Send a message via Yahoo to kingdomgeek
Default

In single.php, find this:

PHP Code:
<?php thesis_show_post_tags(); ?>
Before or after that on a new line, add this:

PHP Code:
<p class="post_tags">Categorized in: <?php the_category(', '); ?></p>
(I'm obviously mimicking the layout/format of tags when they are displayed. I hope it's similar to what you want.)
__________________
Rick Beckman, Kingdom Geek & Thesis Support Ninja (Forums Moderator)
[ Thesis Manual | Help, my posts don't show up! ]


Amazon Wishlist | My custom.css
Get Thesis! | Earn Cash as a DIY Affiliate!

Last edited by kingdomgeek : 08-21-2008 at 12:05 AM. Reason: s/-/_
Reply With Quote
  #3 (permalink)  
Old 08-20-2008, 04:19 AM
Senior Member
 
Join Date: Aug 2008
Location: Columbus, GA
Posts: 189
Default

Rick,
There is a small error in your suggested code. The class "post-tags" should be "post_tags." The post-tags class will not show errors, but the appearance will not be the same as the tags line. It is not defined in style.css, while post_tags is.

The code:

Code:
<p class="post-tags">Categorized in: <?php the_category(', '); ?></p>
Should be:

Code:
<p class="post_tags">Categorized in: <?php the_category(', '); ?></p>
Thank you for all your help here, Rick. I wish I could have a 99.999999999% error-free rate!

Thanks!
__________________
Mike Nichols
Anxiety, Panic & Health
Reply With Quote
  #4 (permalink)  
Old 08-21-2008, 12:08 AM
Senior Member
 
Join Date: Jul 2008
Location: Connersville, IN
Posts: 2,244
Send a message via ICQ to kingdomgeek Send a message via AIM to kingdomgeek Send a message via MSN to kingdomgeek Send a message via Yahoo to kingdomgeek
Default

Good call, Mike! I'm still getting used to the keyboard on this laptop and apparently I'm not catching all the silly typos it's causing me!
__________________
Rick Beckman, Kingdom Geek & Thesis Support Ninja (Forums Moderator)
[ Thesis Manual | Help, my posts don't show up! ]


Amazon Wishlist | My custom.css
Get Thesis! | Earn Cash as a DIY Affiliate!
Reply With Quote
  #5 (permalink)  
Old 08-21-2008, 10:43 PM
Junior Member
 
Join Date: Aug 2008
Location: Haarlem, the Netherlands
Posts: 8
Default

Thank you Rick and Mike for you're solutions.

It works, however the category is only shown at the bottom of each single entry. I would like to see the category on top of each article, on a single page and on the homepage.

URL:
Linux op de desktop — Digiplace
and
AcidRip — Digiplace

and I would like to see it in the line which say's

"Geschreven door Jos op 21 augustus 2008 - 22:21"

so that this line looks like:

"Geschreven door Jos op 21 augustus 2008 - 22:21" in categorie: Desktop, Hardware
Reply With Quote
  #6 (permalink)  
Old 08-21-2008, 11:20 PM
Senior Member
 
Join Date: Jul 2008
Location: Connersville, IN
Posts: 2,244
Send a message via ICQ to kingdomgeek Send a message via AIM to kingdomgeek Send a message via MSN to kingdomgeek Send a message via Yahoo to kingdomgeek
Default

To add the category information to the top of posts, open /lib/functions/content_functions.php and find this:

Code:
get_the_time('F j, Y') . '</abbr>'; ?>
After it, on the same line, add this:

Code:
Categorized in <?php the_category(', '); ?>
(You may need a blank space just before the word "Categorized" to prevent a run-on word.)
__________________
Rick Beckman, Kingdom Geek & Thesis Support Ninja (Forums Moderator)
[ Thesis Manual | Help, my posts don't show up! ]


Amazon Wishlist | My custom.css
Get Thesis! | Earn Cash as a DIY Affiliate!
Reply With Quote
  #7 (permalink)  
Old 08-23-2008, 03:59 PM
Junior Member
 
Join Date: Aug 2008
Location: Haarlem, the Netherlands
Posts: 8
Default

Thx, you are amazing, great support! It worked. But it became somehow with a capital font. I guess a css thing? So I removed it for now and start up reading some more about css/php/html.
__________________
/Jos Herni - http://www.digiplace.nl
Reply With Quote
  #8 (permalink)  
Old 09-02-2008, 08:40 PM
Junior Member
 
Join Date: Aug 2008
Location: Haarlem, the Netherlands
Posts: 8
Smile It works

I must have done something wrong the first time, or the upgrade fixed something. It works like a charm now. Thank you very much!

Digiplace — Linux op de desktop
__________________
/Jos Herni - http://www.digiplace.nl
Reply With Quote
  #9 (permalink)  
Old 09-26-2008, 01:01 AM
Junior Member
 
Join Date: Sep 2008
Posts: 11
Default Category above headline?

Any idea how to place the category name above the headline, like they do here? The Bygone Bureau — A Journal of Modern Thought

Also, how would I make the formatting of the category name look like this?

Thanks.

Mike
Reply With Quote
  #10 (permalink)  
Old 09-26-2008, 01:11 AM
Junior Member
 
Join Date: Sep 2008
Posts: 11
Default Clarification

To clarify, I only want the category name to appear on the main page. When someone clicks on it they'll be directed to the category page, which already has a heading, so they don't need the label in the post anymore. Thanks again.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 02:58 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0