Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 24th Jan 2012, 09:13 PM   #1
Active Warrior
 
drewhowell21's Avatar
 
Join Date: 2011
Location: North Carolina
Posts: 54
Thanks: 6
Thanked 9 Times in 7 Posts
Default
Wordpress Banner Style Post Titles
Share on: 
fb share twitter share gplus share more share

Hey guys. I was bored I figured I would write a "tutorial" for those of you who don't already know how to get this effect. I'm not exactly sure what it's called exactly. "Banner Style Post Titles" is the best I could come up with. Here is what the outcome looks like.


Code ( BACKUP your index.php or try it out on a custom page template first):
PHP Code:
<!-- This should be inside The Loop -->
            <div class="post">
                
                    <div class="postTitle">
                        <h2><a href="<?php the_permalink(); ?>"><?php the_title();?></a></h2>
                    </div><!--end posttitle-->
                    <div class="postimg">
                        <?php the_post_thumbnail(); ?>
                    </div><!--end postimg-->
                    <div class="postcontent">
                        <p><?php the_excerpt(); ?></p>
                    </div><!--end post content-->
                    <div class="sep"></div>
                    <div class="meta">
                        <p>Written By: <span class="author"><?php the_author(); ?></span> on <span class="date"><?php the_date(); ?></span></p>
                    </div>
            </div><!--end post-->
CSS ( I plan on cleaning it up a bit ):

Code:
/* The image I made for for a 500px width */
#content {
	width:500px;
	height:100%;
	background:#fff;
	margin-top:35px;
}
.post {
	width:100%;
}
.post {
	position:relative;
	width:500px;
	padding-top:55px;
	margin-bottom:10px;
	color:#666;
}
/* Negative absolute position for "overhang" effect */
.postTitle {
	position:absolute;
	top:5px;
	left:-15px;
	padding-left:15px;
	text-align:center;
	width:515px;
	height:50px;
	background:url('images/postTitle_bg.png');
}

.postTitle h2 {
	margin:0px;
	color:#FFF;
}
/* Style Post Title Link */
.postTitle a:link {
	color:#FFF;
}
.postTitle a:visited {
	color:#FFF;
}
.postTitle a:active {
	color:#FFF;
}
.postTitle a:hover {
	color:#CCC;
}
/* You will need featured images enabled and thumbnails set to 150x150 */
.postimg {
	float:left;
	width:150px;
	height:150px;
	margin:0px 10px 0px 10px;
}
.postcontent {
	height:100%;
}
.postcontent p {
	margin-bottom:0px;
	padding-right:5px;
	padding-right:5px;
	padding-bottom:3px;
}
.sep {
	width:80%;
	border-bottom:1px dotted #ccc;
	margin-left:auto;
	margin-right:auto;
}
.meta {
	width:80%;
	margin-left:auto;
	margin-right:auto;
}
.meta p {
	margin:7px 5px 0px 0px;
	font-size:60%;
	text-align:right;
}
.author {
	color:#1e81cf;
	font-size:100%;
}
.date {
	color:#1e81cf;
	font-size:100%;
}
If you need to add thumbnail support, add this to your functions.php:

PHP Code:
//Add Support for 150x150 featured images        
        
if ( function_exists( 'add_theme_support' ) ) { 
        
add_theme_support( 'post-thumbnails' ); 
            
set_post_thumbnail_size( 150, 150 );

        } 
Banner Image (Needs to be saved as postTitle_bg.png or changed in the css):


If you want to us the same font as in the picture add this to your header.php:

HTML Code:
 <link href='http://fonts.googleapis.com/css?family=Telex' rel='stylesheet' type='text/css'>
and this in your CSS:

Code:
font-family: 'Telex', sans-serif;
drewhowell21 is offline  
Unread 24th Jan 2012, 10:23 PM   #2
HyperActive Warrior
 
Join Date: 2011
Location: N/A
Posts: 162
Thanks: 75
Thanked 26 Times in 18 Posts
Default
Re: Wordpress Banner Style Post Titles
Share on: 
fb share twitter share gplus share more share

Just a heads up - that banner could easily be done in CSS3 - no images would need to be used.
sodevious is offline  
The Following User Says Thank You to sodevious For This Useful Post:
Unread 24th Jan 2012, 10:25 PM   #3
Active Warrior
 
drewhowell21's Avatar
 
Join Date: 2011
Location: North Carolina
Posts: 54
Thanks: 6
Thanked 9 Times in 7 Posts
Default
Re: Wordpress Banner Style Post Titles
Share on: 
fb share twitter share gplus share more share

Originally Posted by sodevious View Post

Just a heads up - that banner could easily be done in CSS3 - no images would need to be used.
That's funny... I was JUST reading how to do that and about to change the code! Thanks for the heads up, though.
drewhowell21 is offline  
Unread 24th Jan 2012, 10:28 PM   #4
HyperActive Warrior
 
Join Date: 2011
Location: N/A
Posts: 162
Thanks: 75
Thanked 26 Times in 18 Posts
Default
Re: Wordpress Banner Style Post Titles
Share on: 
fb share twitter share gplus share more share

Ha, cool! Not sure if CSS3 would be friendly with IE, but you should give people the option for either or.
sodevious is offline  
Unread 25th Jan 2012, 08:22 AM   #5
HyperActive Warrior
 
Join Date: 2011
Posts: 310
Thanks: 0
Thanked 23 Times in 23 Posts
Default
Re: Wordpress Banner Style Post Titles
Share on: 
fb share twitter share gplus share more share

Yes, you better try it in CSS3. It is much easier to use though.

blogfreakz is offline  
Closed Thread


Bookmarks

Tags
banner, post, style, titles, wordpress


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 02:46 AM.