[NSFW] Two div's wont sit next to each other – they do without PHP
-
I’m trying to get two divs to sit next to each other. This works when there’s no PHP or wordpress hooks, but it won’t work when trying to hook it into wordpress.
Here’s my index:
<?php if (has_post_format('status')) : ?> <div class = "twocolumnpost"> <div <?php post_class() ?>> <?php if (has_post_thumbnail()) : ?> <div class = "post-thumb"> <a href="<?php echo the_permalink(); ?>"><?php the_post_thumbnail(); ?></a> </div> <?php endif; ?> </div> </div> <?php else : ?> <div class = "singlecolumnpost"> <div <?php post_class() ?>> <?php if (has_post_thumbnail()) : ?> <div class = "post-thumb"> <a href="<?php echo the_permalink(); ?>"><?php the_post_thumbnail(); ?></a> </div> <?php endif; ?> </div> </div> <?php endif; ?>
And my CSS:
.singlecolumnpost .post { float: left; display: block; } .twocolumnpost .post { float: left; display: block; width: 50%; } .singlecolumnpost img { display: block; max-width: 940px; max-height: 529px; width: 100%; padding: 5px 0; } .twocolumnpost img { max-width: 460px; max-height: 259px; width: 100%; padding: 5px 0 5px 0; }
Any help would be really appreciated.
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘[NSFW] Two div's wont sit next to each other – they do without PHP’ is closed to new replies.