Support » Fixing WordPress » Insert automatic line between blog entries

  • jennaburpee



    I am trying to find the easiest way to insert a thin line between blog posts so it automatically separates each post on my main page:

    I’ve read a few older reviews, but I am very new to web design so will need in depth instructions on where/how to edit the css sheet if that’s what I will need to do! I am currently using the 2013 WP Theme.

    Thanks in advance!

    The blog I need help with is

Viewing 1 replies (of 1 total)
  • Gemfruit


    You should have something very close to this in your index.php file.

    <?php if (have_posts()) : ?>
    						<?php while (have_posts()) : the_post(); ?>
    						<div <?php post_class("home-page-post") ?> id="post-<?php the_ID(); ?>">
                                <?php if ( function_exists("has_post_thumbnail") && has_post_thumbnail() ) { the_post_thumbnail(array(260,200), array("class" => "alignleft post_thumbnail")); } ?>
    							<h2 class="title"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
    							<div class="entry">
    								<?php echo(get_post_meta($post->ID, '_yoast_wpseo_metadesc', true)); ?>
    						</div><!--/post-<?php the_ID(); ?>-->
    				<?php endwhile; ?>
    				<?php else : ?>
    					<h2 class="center">Not Found</h2>
    					<p class="center">Sorry, but you are looking for something that isn't here.</p>
    					<?php get_search_form(); ?>
    				<?php endif; ?>

    You’ll want to add the css to create the line to your style.css, then add that class to the above code, right after this:

    <div class="entry">
    								<?php echo(get_post_meta($post->ID, '_yoast_wpseo_metadesc', true)); ?>
    						</div><!--/post-<?php the_ID(); ?>-->

    Essentially, that’s the loop that is going to find all of your posts to display, then display them. At the end of the loop, you add the line, which will put the line between each post.

Viewing 1 replies (of 1 total)
  • The topic ‘Insert automatic line between blog entries’ is closed to new replies.