Forums

Different Headers for Categories - Need Code Help (2 posts)

  1. Velanche
    Member
    Posted 3 years ago #

    So I've ventured on my own, looking over some other postings, to construct a code that I've placed in the header section that would pull a banner for different categories in a post. Once I get this to work, I also intend to modify it for pages, too.

    But this is the code I've placed in the header section that seems to be ignored at the moment...

    <div id="header" <php if (in_category(8)) echo {'style="background: url(http://www.urbanlandscapes.org/wordpress/images/ul-cat-charts.png) no-repeat;"'};
    elseif(in_category(1)) echo {'style="background: url(http://www.urbanlandscapes.org/wordpress/images/ul-cat-news.png) no-repeat;"'};
    elseif(in_category(9)) echo {'style="background: url(http://www.urbanlandscapes.org/wordpress/images/ul-cat-playlists.png) no-repeat;"'};
    elseif(in_category(2)) echo {'style="background: url(http://www.urbanlandscapes.org/wordpress/images/ul-cat-reviews.png) no-repeat;"'};
    elseif(in_category(12)) echo('style="background: url{http://www.urbanlandscapes.org/wordpress/images/ul-cat-podcasts.png) no repeat;"';} ?>>
    </div>

    I've moved the banner images to the same directory as the Wordpress root. Other than that, not sure what I'm missing. Any help would be appreciated....thanks.
    Velanche

  2. moshu
    Member
    Posted 3 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic