Jump to content


Photo

Wordpress Theme Div "Stretching"


  • Please log in to reply
No replies to this topic

#1 tmatthew

tmatthew

    Young Padawan

  • Members
  • Pip
  • 14 posts

Posted 11 July 2010 - 02:54 PM

Hi guys, was wondering if someone could help me out. This might be really obvious, but I've no experience with wordpress themes before I started this project.

I've created my theme and I'm quite happy with it so far, it's all running smoothly except for the content. The test posts I have created over-run the end of the theme, so they go over the footer. Basically I want the div tags holding the wordpress info to stretch as more content is stored within it.

I've no idea how to do this and have tried Googling with no luck.

Here are the CSS codes I'm using (I've only included the ones relevant to the div's I'm talking about):

.mainbody {
	width: 900px;
	height: 550px;
	margin: auto;
	background-image: url(images/mainbody.jpg);
	background-repeat: repeat-y;
	padding-top: 10px;
	display: block;
}

.maincontent {
	width: 840px;
	margin: auto;
	display: block;
}

.mainposts {
	width: 640px;
	float: left;
	float: left;
	display: block;
}

.post {
	margin-left: 10px;
	font-family: "Trebuchet MS", Calibri, Tahoma;
	width: 620px;
	display: block;
}

.post a {
	text-decoration: none;
}

.entry {
	font-family: "Trebuchet MS", Calibri, Tahoma;
	font-size: 13px;
	margin-top: -18px;
	display: block;
}

And the index.php page (again only the relevant bits):

<div class="mainbody">

<div class="maincontent">
  
 		 <div class="mainposts">
		 
		 	<?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>
			
			
			<div class="post">
			
				<h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
			
			
				<div class="entry">
			
					<?php the_excerpt(); ?>
					
				   	<p class="postmetadata">

					<?php _e('Filed under:'); ?> <?php the_category(', ') ?> <?php _e('by'); ?> <?php  the_author(); ?><br />

					<?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?> <?php edit_post_link('Edit', ' | ', ''); ?>

					</p>
			
		   		</div>
			
			</div>
			

			<?php endwhile; ?>
			
			<div class=”navigation”>
				<?php posts_nav_link('in between','before','after'); ?>
			</div>
			
			<?php else : ?>

			<div class="post" id="post-<?php the_ID(); ?>">
			<h2><?php _e('Not Found'); ?></h2>
			</div>

			<?php endif; ?>
		 
		 </div>
  
		  <div class="sidebar"></div>

	</div>

</div>

And for good measure, in case I haven't explained myself properly, my site: Here

There may be a couple of things that look a little weird in there (such as display: block), but like I say I've been Googlin' and have come across supposed solutions that just haven't worked for me.

I'd appreciate anyone who could help me with this, as it's driving me mad. :D




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users