Wordpress Themes - WP Forum at BFA
Click here to register or to donate.
Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme »

[SOLVED] Images as Category Titles


  #1  
Old Jul 15, 2009, 04:59 AM
hejonas
 
8 posts · Jul 2009
Hi

I am overwhelmed by all the great possibilities atahualpa offers - even to a css-beginner like me.
please let me ask you one question, that still remains unanswered after searching and browsing through the board.

how can I display images instead of categories? ie an image instead of "Category: XY"?

thanks
Jonas

Last edited by hejonas; Jul 15, 2009 at 07:42 AM.
  #2  
Old Jul 15, 2009, 05:03 PM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
Where in the layout? I don't know a place that starts with Category:
  #3  
Old Jul 16, 2009, 03:37 AM
hejonas
 
8 posts · Jul 2009
thanks for the reply and sorry for being unclear.

I refer to the Footer Box in a post (see screenshot). What I want to achieve is to display different small images (according to category) instead of «Category: Non classé», whilst still be able to set the category in the admin tool.
Attached Thumbnails
Click image for larger version

Name:	screenshot_footerbox.JPG
Views:	538
Size:	3.4 KB
ID:	191  

Last edited by hejonas; Jul 16, 2009 at 04:00 AM.
  #4  
Old Jul 16, 2009, 02:35 PM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
You could try

<?php $all_categories = get_the_category();
$cat_id = $all_categories[0]->cat_ID; ?>
<span class="<?php echo $cat_id; ?>">%category-linked%</span>

in the post into items, and then add a CSS Insert for each category ID

span.12 {
background: url(/path/to/image12.gif) center left;
}
span.19 {
background: url(/path/to/image19.gif) center left;
}
span.25 {
background: url(/path/to/image25.gif) center left;
}
  #5  
Old Jul 16, 2009, 04:23 PM
hejonas
 
8 posts · Jul 2009
thanks very much, much appreciated!
what do you mean exactly by «for each category id». could you please make an example with the code.

thank you
best regards, j
  #6  
Old Jul 16, 2009, 08:54 PM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
At WP Admin -> Posts -> Categories, if you point the mouse at the title of a category you'll see a URL ending on "...action=edit&cat_ID=XX" in the status bar at the bottom of the browser viewport. XX is the ID of that category.

The PHP code I posted above should wrap a link to the first category of a post into a <span> element with a CSS class (i.e. "13") which equals the (Wordpress) ID (i.e. "13") of that first category.

<span class="13"><a href="link-to-category">Category Title</a></span>

You could then style each one of these <span> elements with a CSS Insert. The example above would cover 3 example categories, with the ID's 12, 19 and 25.

BTW, the images in the CSS example don't have to include the category ID in their file name. I just made the example that way.

Last edited by Flynn; Jul 16, 2009 at 08:57 PM.
  #7  
Old Jul 17, 2009, 03:17 AM
hejonas
 
8 posts · Jul 2009
thanks Flynn.. now I 'perfectly' understand the solution, but still..it doesn't work

it looks like span.[any id] in css does not affect the footer at all.

div.post-footer does however, but then I am not able to use different category ids..

what could possibly go wrong? do you need more info?

sorry for bothering again!
  #8  
Old Jul 17, 2009, 04:43 AM
hejonas
 
8 posts · Jul 2009
ok, I have now found another way:

.category-daily {
background: url('/images/tabs-2.gif') 0px -482px no-repeat;
height: 103px;
}

but it has become quite a «gebastel».

and what is rather funny, is that the Footer (Copyright © 2009 etc) is now right in the middle of the page. please help
no idea what happened: the footer and also the comment box are now overlapping the post....

---> my complete lack of knowledge turned out to be disastrous, I am resetting. thanks anyway.

Last edited by hejonas; Jul 17, 2009 at 05:09 AM.

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Putting images in place of widget titles ken.miller Sidebars & Widgets 4 Jun 25, 2009 01:38 PM
[SOLVED] category page list...display images too? joshimotions Excerpts, Read more, Pagination 1 Jun 21, 2009 10:56 AM
Customizing category menu bar with different images for every item GeoParadise Page & Category Menu Bars 5 Apr 17, 2009 06:50 PM
Images in my category and archive pages? middlemountain Atahualpa 3 Wordpress theme 1 Apr 11, 2009 11:28 PM
How do I use TTF Titles Plugin on the widget titles? chavahn Sidebars & Widgets 0 Mar 5, 2009 11:05 AM


All times are GMT -6. The time now is 02:18 AM.


Powered by vBulletin® Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.