• Resolved tmillerwriter

    (@tmillerwriter)


    I can’t figure it out, but after the first post that appears in the search results, the second, third, etc. indent which is why I think my sidebar is only getting bumped down on search results where there ARE posts. When the “sorry, no posts match your search” form comes up, everything is fine.

    How can I align left all my posts in my Search Results?

    Thx.

    ibeamforlife.com/blog

Viewing 5 replies - 1 through 5 (of 5 total)
  • each time your search find a new result, it creat a new div which will contain all the other result

    you have a padding inside this div, so each time you have more…space

    you have to modify the padding of the #content .post in your css

    the div holding the post is not closed properly. so each next post is somehow nested in the one before, leading to this shifting behaviour.

    if your theme has a search.php, edit this and find:

    <!-- div--><!-- /post -->

    change it to

    </div><!-- /post -->
    Thread Starter tmillerwriter

    (@tmillerwriter)

    Ah, I was going to be so excited to find that incorrect div, but when I went to search.php the fix you suggested was not needed. The div was closed properly, as you can see.

    Any other suggestion for the div?

    <?php get_header(); ?>
    
        <div id="content" class="two-column float-left">
    
    		<?php if (have_posts()) : ?>
    
            <?php while (have_posts()) : the_post(); ?>
    
            <div class="post">
    
            <h1><a href="<?php the_permalink() ?>" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h1>
            <?php the_excerpt(); ?> <a href="<?php the_permalink(); ?>">Read more...</a>
    
            </ div><!-- /post -->
    
            <?php endwhile; ?>
    
            <div class="content-bot">
    
            <?php next_posts_link('&laquo; previous') ?>
            <a href="<?php bloginfo('url'); ?>">home</a>
            <a href="#">top</a>
            <?php previous_posts_link('next &raquo;') ?></p>
    
            </div><!-- /content-bot -->
    
            <?php else : ?>
            <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
    
            <?php endif; ?>
    
        </div><!--/content -->
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>
    Thread Starter tmillerwriter

    (@tmillerwriter)

    I also tried changing the padding as forerunner mentioned, and that had no effect on the nesting either.

    #content .post { float: left; padding: 0px 10px 0px 10px; margin-bottom: 10px; }

    It was 15px left and right, and I changed it to 10px, but nothing happened. Also, if I did that, wouldn’t it change the display of my postings overall, not just postings in Search results?

    Thread Starter tmillerwriter

    (@tmillerwriter)

    Oh my goodness. I’ve been looking at this for WEEKS, and I just kept looking until I noticed it — ONE space extra between a / and div.

    Thank you both for keeping me directed at the div. I fixed it.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Search results — second posts indent’ is closed to new replies.