Dynadot Aftermarket: discover domain gems worth investing in. Visit our aftermarket.

HTML, CSS and the Wordpress loop!

SpaceshipSpaceship
SpaceshipSpaceship
SpaceshipSpaceship
Watch

rachit14nov

Established Member
Impact
0
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!
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back