Image alignment in dynamic sidebar
-
Fellow wordpressers,
I’m having trouble with my sidebar at present. I run several dynamic sidebars across my site, each with the purpose of holding different info for each parent page. On the blog page, I wish to show a list of recent posts in the sidebar with the post thumbnail, date of post and the post title. FYI, I run blog posts from a custom page set-up in the function php.
Anyway, the image and text displays fine, however they won’t align properly in the sidebar. I’m assuming this is a css issue, and so having combed my way through, I’m stuck looking at the widget container, which holds this:
/* entry images */ img.alignleft, img.alignright { padding:10px; } img.alignleft { float:left; margin:0 15px 15px 0; display: inline; } img.alignright { float:right; margin:0 0 15px 15px; display: inline; }
No matter what I do, I can’t seem to get them to align. Below is the text I use in my sidebar to get to where I am now:
<div class="widget container"> <ul> <?php query_posts('posts_per_page=5&post_type=blog'); if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <li> <a>" title="<?php the_title(); ?>"><?php the_post_thumbnail() ?></a> <?php the_time('jS F, Y') ?> <a>" href="<?php the_permalink(); ?>"><?php the_title(); ?></a> </il> <?php endwhile; else: ?> ..If the query parameters are not met, the alternate content goes here.. <?php endif; wp_reset_query(); ?> </li> </ul> </div>
You can view the page in questionhere
Any help as to how this can aligned will be most helpful.
- The topic ‘Image alignment in dynamic sidebar’ is closed to new replies.