• Resolved IntMilkBrilliant

    (@intmilkbrilliant)


    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.

Viewing 1 replies (of 1 total)
  • Thread Starter IntMilkBrilliant

    (@intmilkbrilliant)

    For anyone who may be searhing for an answer in the future, I’ve figured it out. I just added the following code to my widget container for the image:

    div.widget-container ul li img {
    		float:left;
    		margin-right:8px;
    		}

    Hope this is of some help to anybody else searching the forums.

Viewing 1 replies (of 1 total)
  • The topic ‘Image alignment in dynamic sidebar’ is closed to new replies.