Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Header configuration & styling (http://forum.bytesforall.com/forumdisplay.php?f=15)
-   -   How to put different header image per category (http://forum.bytesforall.com/showthread.php?t=7523)

unelma Jun 10, 2010 11:28 AM

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.

juggledad Jun 10, 2010 11:45 AM

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

crashley1784 Mar 18, 2011 05:41 PM

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?

juggledad Mar 18, 2011 06:13 PM

Should be as long as the post is not in multiple categories. In that case I think wordpress gives the first

crashley1784 Mar 18, 2011 07:07 PM

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....

juggledad Mar 18, 2011 07:54 PM

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">
When you click on a post, the CLASS changes to
HTML Code:

<body class="single single-post postid-163">
so any CSS Selector that depends on the <body...> having a category class will not apply.

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

keldan Jan 31, 2012 02:14 AM

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

juggledad Jan 31, 2012 04:08 AM

what is the url?

rickheck Apr 8, 2012 12:45 PM

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...

havocart Jul 15, 2012 07:37 PM

Quote:

Originally Posted by rickheck (Post 83277)
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...

--- I would love to know how to "use a specific header image for a specific page/post" but the above link that you have posted does not work for me... any advice? I am more than willing to dive into the code, although somehow with this theme, I actually haven't needed to until now! It's pretty great.

Thanks.

juggledad Jul 16, 2012 04:09 AM

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

havocart Jul 17, 2012 11:01 AM

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?:)

juggledad Jul 17, 2012 12:41 PM

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.