Support » Themes and Templates » Different banners for different categories

  • Hello.

    I am tryin’ to show a different banner on every category page, instead of the boring <h2> that is default on archive.php file.

    So I created a banner for every category, and named it after the category’s title; for example, category “Pizza” has a banner called pizza.gif, and category “Chinese Food” has a banner called chinese-food.gif.

    After that, I put this code on my archive.php file (where blahblahblah is my URL), ’cause I didn’t want to write an is_category conditional for EVERY category:
    <img src="http://blahblahblah/<?php single_cat_title (); ?>.gif">

    Now, when I open the various categories on my browser, I can only see the banners whose filename is a one-word one. Not the others.

    So, to avoid the problem, I thought I could rename the banners with the category’s ID, and change the php code into my <img> tag, but I found that the tag the_category_ID is not active anymore….

    What can I do?

Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Different banners for different categories’ is closed to new replies.