PDA

View Full Version : HTML, CSS and the Wordpress loop!



jakey
18 Nov 2009, 01:14 PM
Heya guys,

At the moment I'm trying to work out a problem with a blog I'm working on.

It uses the wordpress loop as I don't require much of the functionality which comes as standard.

The loop (And HTML)


</div>
</div>
<div id="post-start">
<?php
require('/var/www/html/blog-backend/wp-blog-header.php');
?>

<?php if(have_posts()) : while(have_posts()) : the_post(); ?>
<?php static $count = 0;
if ($count == "4") { break; }
else { ?>

<div class="post mypost<?php echo $count; ?>">
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<br /><div class="entry">
<?php the_content(); ?>
<?php echo "<b>" . $count . "</b>"; ?>
</div>

<?php $count++; } ?>
<?php endwhile; ?>
<?php endif; ?>
</div>
</div>

The idea behind this is that each post (Up to four at a time) will be split into a different div class for individual styling, the problem I'm experiencing is every post will start with an image and be expandable via the prototype+accordion JS library. Underneath every image I'd like a couple of lines of text, no matter how tall the image is (The length will always be the same).

Is it possible to split the image and text into seperate divs within the loop?

Is it possible to set the image to automatically expand the div tag based on it's height as to always have a set amount of space underneath it for the text?

Thanks for listening!
J.