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 use different header image for blog section of site (http://forum.bytesforall.com/showthread.php?t=13693)

kitfreeman Apr 7, 2011 11:52 AM

How to use different header image for blog section of site
 
Hi

I use Atahualpa as the CMS for my personal website, which includes numerous static pages and a blog. I have a generic header for the static pages, but I'd like to use a different header for the blog (same size but with different text). Can anyone tell me how to this, please?

Thanks!
Kit

lmilesw Apr 7, 2011 02:23 PM

You could use the Dynamic Headers plugin by Nicasio and replace %image with the code they give you. Then set the default header media to the image you currently have and set a special image for the Blog Page Header in the setting for the plugin.

kitfreeman Apr 8, 2011 03:00 PM

Thanks for the suggestion. That sounds perfect. Just a quick follow-up if I may, please: What exactly do I need to do to make the replacement you mention? (Sorry, I'm new to this.) The plugin's instructions say to add the line <?php if(function_exists('show_media_header')){ show_media_header(); } ?> to the theme header.php file. Is that the line of code you mean? If so, where do I make the replacement, please?
Thanks again for your help.

lmilesw Apr 8, 2011 10:03 PM

Yes. That is the line of code I mean but instead of putting in the header.php file you just put in the Configure Header Area box in place of %image. You may have to use some CSS to make it fit properly but I have used this with success.

kitfreeman Apr 8, 2011 10:40 PM

Thanks! That worked for me too. However, the header opacity and resizing (fluid width) functions no longer work. Do you know if there is any way to keep those functions while using the dynamic headers plugin, please?

juggledad Apr 9, 2011 03:56 AM

Once you remove the %image, you no longer run the code that handles the header opacity.

kitfreeman Apr 9, 2011 03:59 AM

Quote:

Originally Posted by juggledad (Post 62802)
Once you remove teh %image, you no longer run the code that handles the header opacity.

Thanks for the information. Is there a workaround, or does this mean there's no way to keep Atahualpa's header functions and use the dynamic headers plugin?

Do you know of any other way to use a more than one header with Atahualpa, please?

juggledad Apr 9, 2011 05:03 AM

You can always use the CSS method where you use the page ID with the 'body' CSS selector to define the image. see HOWTO: have one header image on one page, and another image on another page

kitfreeman Apr 12, 2011 02:12 PM

Thanks very much for the suggestion. So if I wanted a different header on page-id-1 I'd need to add something like this:

body.page-id-1 div#imagecontainer {
background-image: url(http://XXXX.com/wordpress/wp-content/uploads/pg1header.jpg);}

Is that right? And (dumb question, I know), where does it go, please?

lmilesw Apr 12, 2011 02:22 PM

You may have to add !important as shown in the examples but yes, that looks right. You would put this in ATO>Add HTML/CSS Inserts>CSS Inserts.

kitfreeman Apr 12, 2011 02:40 PM

Thanks. I'm very grateful for your help. Just one more quick question, if I may, please: The part of the site on which I want to use a different header is the blog. The relevant pages are identified with <body class="blog">. How do use that in the css? It's not a page-id, postid, or a tag.

lmilesw Apr 12, 2011 03:00 PM

Probably body.blog

kitfreeman Apr 12, 2011 04:02 PM

Thanks again. I tried:

body.blog div#imagecontainer {
background-image: url(http://XXXX/XXX.jpg) !important;}

It nearly works! It switches off the default header on the blog pages (while leaving it on the other pages), but it doesn't load the new banner at http://XXXX/XXX.jpg

Do you have any idea what's missing, please.

Thanks again -- I'm very grateful for your support.

kitfreeman Apr 12, 2011 04:42 PM

Update. I've fixed the problem (was using the full url instead of starting with /wp-content.

The only remaining problem is that the effect only works for the blog main page, not for category pages. Do you happen to know if there any way to automatically cascade the effect to categories, or do I have to add an extra command for each category?

Thanks again for your help.

juggledad Apr 12, 2011 05:45 PM

look at the <body...> statement on the category pages - I think you'll see a class of 'category' and 'category-xxxx' where xxxx is the category name. If you want it for one category use the' body.category-xxxx.', if you want it for all use ' body.category'

ibrown Oct 3, 2011 09:56 PM

Hello. I am having a similar issue. The site I am currently working is built of pages and I am using your instructions to have different headers for certain pages using CSS and html. The platform we are working with does not grant us FTP access so no php editing.

I was asked to add a blog, so I created a page titled "Blog" and used the settings in Reading to send posts to the "Blog" page. The posts syndicate properly however the header poses a problem. The "body.page-id..." fix works as a page, but the header does not appear once posts are attributed to that page. I tried using "body.blog" and the other identifiers you mentioned but nothing works. I did a view source and found that the "Blog" page (with posts) has "<body class="logged-in">" unlike normal pages which show page-id etc. Am I missing something important, or is there a specific identifier that can target the page?

Also each of the individual posts do not have headers. It would be ridiculous to have to assign an insert for each post using "body.postid...". Is there a way to have all individual blog posts use an assigned header that will be automatically used on any subsequent post?

I made a dummy blog on the same system so you can get an idea of my problem.
http://testmomentblog.commons.gc.cuny.edu/?page_id=22

juggledad Oct 4, 2011 05:34 AM

something seems messed up with your wordpress install. Your 'blog' page is showing with
HTML Code:

<body class="">
the theme is calling the WordPress function 'body_class();' which is returning the information. So something is screwy. Try swapping to the twenty-eleven theme and seeing what shows up on the <body...> statement

2) if you look at the source of a single post page and find the <body... statement you will see the classes assigned to it. You can use any of them that would be the same for all post pages.

ibrown Oct 5, 2011 08:17 AM

I switched themes and the same problem occurs. Regular pages have classes listed
HTML Code:

<body class="logged-in page page-id-6 page-child parent-pageid-2">
But that blog page <body...> is empty except for "logged-in" even in a different theme.

Thanks for the single post tip. Works like a charm.

juggledad Oct 5, 2011 08:20 AM

try shutting off all your plugins, there may be a conflict

ibrown Oct 5, 2011 05:34 PM

All plugins are off, same result. Is there a way to assign a class to the blog? Hopefully using inserts...

juggledad Oct 5, 2011 07:19 PM

if this issue occurs when all plugins are off and it also occurs when using twenty-eleven, and you aren't using any templates, then it's not a theme issue, there is an issue with your wordpress install.

You might want to check the error log at your host to see if any messages are coming up


All times are GMT -6. The time now is 11:10 AM.

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