How to put different header image per category
Hi,
I have put different header image in every page like this: (ATO > CCS inserts) body.page-id-2 div#myimage { background-image:url('/wp-content/themes/atahualpa/images/header_etusivu2.jpg') !important; position:relative; margin:0; padding:0; height:287px; } And my default image is: #myimage { background-image:url('/wp-content/themes/atahualpa/images/header_etusivu2.jpg') !important; position:relative; margin:0; padding:0; height:287px; } I also have to define different image per category. How I could do it? Thanks for help :) I am using: Atahualpa 3.4.9 WordPress 2.9.2. |
use 'body.category-xxxxxxxx div#myimage' where xxxxxxx is the name of the category. You can find this by viewing the page, look at the source and fine the <body... statement
|
Will this solution work for all posts in a given category? So, for example, I have 3 posts in Category x. When someone is looking at post 1 in Cat x, will the Cat x header be displayed?
|
Should be as long as the post is not in multiple categories. In that case I think wordpress gives the first
|
Sad face...
I got the header images to change per category page, but when a user clicks on a particular post in that category, the header image reverts to the default image. You can see what I mean here: http://www.laurenacooper.com/thoroughfare When you click on "Alumni Esplanade" in the category menu, the image is shown correctly. But when you click on the actual post to view it, the default header is shown. The same is true for all the other categories. Is there any way to work around this aside from manually assigning the header image by css for each individual post?? Geez I hope so because this is EXACTLY what I needed for this site, and I hope to God that I don't have to write css for every single post.... |
the CSS to set the image based on the category is using the CLASS that WordPress assigns to the <body... > statement like
HTML Code:
<body class="archive category category-alumniesplanade"> HTML Code:
<body class="single single-post postid-163"> So unless you find a plugin that will add the category to the body statement, or edit the WordPress code, if you want a particular image based off the BODY class, it looks like you will have to have css for each postid-xxx sorry |
new to wordpress and atahualpa enthusiast, yet stuck... I'm trying to use different header images both in pages and categories, put the above code in CSS Insert (obviously changing images names) but the header is still the same, i.e. the only image I left in ./header folder. Did I miss/mess something? I'm using 3.7.3
thanks |
what is the url?
|
There is a way to use a specific header image for a specific page/post. Take a look at how I did it here http://forum.bytesforall.com/showthread.php?t=17243 .
It does require modifying one of the theme files, but it works quite well. Plus gives you the ability to suppress parts of a page/post (like the byline), and the use of the 'STB custom query' features of that template (it is based on that template). ....Rick... |
Quote:
Thanks. |
that link goes to the gold forums. The Gold Forums are avaliable to members who have doated $20 or more in support of the theme author and/or moderators
|
I thought so, however, I have already gladly donated that much when I first used this template 06/23/12 via the link provided in the options panel of the template. I did sign up for this forum at a later time though...
Any chance of getting hints to what that gold-plated link says?:) |
Send me a pm wite the PayPal transaction and your PayPal ID
|
All times are GMT -6. The time now is 12:08 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.