View previous topic :: View next topic |
Author |
Message |
bluepxl
Joined: 10 May 2003 Posts: 31
|
Posted: Wed Jun 18, 2003 6:46 am Post subject: how to make the categories display as images in the posts? |
|
|
in the category list along the side i want them to remain in text. however, i would like to do little icon images within the post for the respective category. so rather than it write out [general] i would like to do an icon showing an image of whatever i want...
how would i go about doing this? |
|
Back to top |
|
 |
Graam
Joined: 20 Dec 2002 Posts: 134
|
Posted: Wed Jun 18, 2003 11:52 am Post subject: |
|
|
You could make some images called catergoryname.jpg and then use this in your template:
Code: | <img src="http://yourdomain.com/yourimagedirectory/<?php the_category() ?>.jpg" /> |
This could of course be very wrong, but I don't see why it shouldn't work... _________________ tin-men
powered by 
Last edited by Graam on Sat Jun 21, 2003 8:48 am; edited 1 time in total |
|
Back to top |
|
 |
dherold
Joined: 21 Jun 2003 Posts: 2
|
Posted: Sat Jun 21, 2003 6:42 am Post subject: |
|
|
Graam's scheme works, but you have to use the_cat_ID() not the_category. I'm not sure why, exactly.
Anyway, you number your images 1.jpg, 2.jpg and so on, rather than naming them after the categories.
If you put the code immediately before the content tag in your template and add an align="left" or "align="right" to Graam's image code, your "icon" will show up in the first lines of your post. It won't affect the category list in your sidebar, |
|
Back to top |
|
 |
Gadget Girl
Joined: 25 Jan 2002 Posts: 305 Location: Virginia
|
Posted: Mon Aug 04, 2003 6:29 pm Post subject: |
|
|
Is that what you did on your blog? Way cool, thanks!  |
|
Back to top |
|
 |
|