Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Center area post/pages (http://forum.bytesforall.com/forumdisplay.php?f=32)
-   -   [SOLVED] Style a post (blog page) different than a page (cms)? (http://forum.bytesforall.com/showthread.php?t=11918)

jasontbedell Dec 29, 2010 07:28 AM

[SOLVED] Style a post (blog page) different than a page (cms)?
 
Hello,

I've been searching the forums but haven't been able to figure this one out. I am working on http://litteacher.com. My friend wants to add this image (http://litteacher.com/wp-content/the...ond-header.png) to the top of just the blog pages.

You can see it more clearly here in this mockup: http://web.me.com/mwfbooks/SOS/Site_...ite.blog.2.jpg. The image is appended directly to the top of the background of the center column.

This would be on the main blog page (called "Blog") and on the single post pages. I would need to keep the rest of the site, acting as a cms, as it is.

So, I guess there are really two related issues. Is it possible to add this image to the top of the center column with no spacing or padding between the image and the background of the center column? And, is it possible to only do this for the blog, both multi- and single-post, pages?

Thank you for any help or direction you can provide. I keep recommending this theme and forums to friends because of how helpful and knowledgeable the people here are.

Jason Bedell.

lmilesw Dec 29, 2010 09:30 AM

The Dynamic Headers plugin should do the trick.

jasontbedell Dec 29, 2010 10:30 AM

Thank you. Which option would you recommend and, if 1, where should I add the code?


Option 1 (Recommended): Simply drop the this line of code into your theme file that controls your header (usually header.php)

Note: The location to add this code can vary widely from theme to theme and depending on your theme's css settings you may have to use Option 2 and modify the CSS of your theme **BACKUP ANY THEME FILES BEFORE MODIFYING**

<?php if(function_exists('show_media_header')){ show_media_header(); } ?>

This will automatically determine what type of media you are using and generate the appropriate code to insert it. No other coding is required on your part.

Option 2: You can use this line of code to simply get the URL of the media for a particular post or page. This will allow you to do some more advanced things and embed the media yourself if you know what you are doing.

<?php if(function_exists('dh_get_page_image_url')){ $dynamic_header_url = dh_get_page_image_url(); } ?>

You can then use the variable $dynamic_header_url however you see fit. It will contain the full path to your media file for that particular page/post, including any default media that should be shown.

Thank you again.

jasontbedell Dec 29, 2010 10:39 AM

OK. I found another thread where Juggledad answered that question. The only other question I have about it is if it is possible to disconnect it from the header (I guess I could add a transparency to the top of the image if necessary) and connect it to the background of the center column?

jasontbedell Dec 29, 2010 11:06 AM

It looks like I should be able to remove it with:

td#header {
padding-bottom:0;
}

What class would I add to the td#header to make it only relevant to blog pages?

Thank you.

jasontbedell Dec 29, 2010 12:49 PM

Code:

body.post-172 td#header {
padding-top: 40px;
padding-bottom: 0;
}

This code works just for the blog page, but I don't know how to make it work for all the single-post pages.

Also, when I add this back in to fix the rest of the pages, it messes up what I had working on the blog page.
Code:

td#header {
padding-top: 40px;
padding-bottom: 15px;
}


lmilesw Dec 29, 2010 01:11 PM

I am not real clear on what you are trying to accomplish but perhpas conditional php could help.

jasontbedell Dec 29, 2010 01:16 PM

Basically, on the blog page, I need the picture that is displayed to connect (no spacing) with the center column.

I can do this by eliminating the bottom padding in the header.

The problem in doing so is that the rest of the pages look funny; the spacing just looks wrong when that padding is removed.

Can I put php in HTML/CSS Inserts?
If so, how would I structure it?

PHP Code:

If on blog page then,
CSS
else
CSS

I know some PHP but I'm not sure how to structure the "on blog page" part.

juggledad Dec 29, 2010 01:37 PM

setup the site the way you want it for all but the blog page, then add CSS Inserts to style the blog page and use 'body.blog' as the beginning selector.

For example, lets say you set the post body copy to display in blaxk, but you want them red on the blog page, you would use
HTML Code:

body.blog .post-bodycopy {color: red;}

jasontbedell Dec 29, 2010 01:44 PM

Juggledad,

That worked perfectly. You really are brilliant at this. If it helps anyone else, I used
Code:

td#header {
padding-top: 40px;
padding-bottom: 15px;
}

body.blog td#header {
padding-top: 40px;
padding-bottom: 0;
}

.
If you could, what would I put to include the single-post pages?

LMilesSW, you're help was invaluable as well. The dynamic header worked very well. Thank you both for your time.

juggledad Dec 29, 2010 01:49 PM

just use 'body.single.....'

jasontbedell Dec 29, 2010 01:53 PM

Thanks for putting up with me. :) I think you declare the thread solved.


All times are GMT -6. The time now is 01:17 PM.

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