Trying to put a line between post (11 posts)

  1. anxo69
    Posted 8 years ago #

    Hello, Im trying to put a line between my post. Ive read a couple ways but cant seen to make it work.

    Here is my main index php post section:

    <div id="contentleft">
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <h1>" rel="bookmark"><?php the_title(); ?></h1>
    <?php the_time('F jS, Y'); ?>
    <p>Filed Under <?php the_category(', ') ?></p>

    <?php the_content(__('Read more'));?><div style="clear:both;"></div>

    <?php trackback_rdf(); ?>

    <?php endwhile; else: ?>

    <p><?php _e('Sorry, no posts matched your criteria.'); ?></p><?php endif; ?>

    <?php comments_template(); // Get wp-comments.php template ?>
    <hr />

    can somebody tell me where I put the <hr /> to make a line show up after all post?

    Also where is the can I put the custom style code for the hr anywhere in my css? I was going to put it at the bottom.

    Id like the line to be like 2px light grey.


  2. Jaap
    Posted 8 years ago #

    The code for a line is <hr> forget about the /

  3. Jaap
    Posted 8 years ago #

    Sorry don't forget i read it like /hr

  4. boober
    Posted 8 years ago #

    try putting it after this

    <?php the_content(__('Read more'));?><div style="clear:both;"></div>

    and you can put the new class anywhere in your css.

  5. anxo69
    Posted 8 years ago #

    Thanks boober, I tried it and no luck. Its weird.

    Ive tried, example:

    <?php the_content(__('Read more'));?><div style="clear:both;"></div><hr />

    and example

    <?php the_content(__('Read more'));?><div style="clear:both;"></div>
    <hr />

    could I have a block somewhere??

  6. boober
    Posted 8 years ago #


    <?php the_content(__('Read more'));?><hr /><div style="clear:both;"></div>
  7. anxo69
    Posted 8 years ago #

    nope no go.

    my address is http://www.markarcaro.com too.

  8. carlscape101
    Posted 8 years ago #

    just wondering why the <hr />

    Why not just <hr>

    (I do get confused now and then)
    but I thought horizontal rule was

    I know i'm making myself look like an idiot here but..

    But since i'm dumb :)
    This might help:

  9. anxo69
    Posted 8 years ago #

    thanks carlscape101- I tried the <hr> in the same places as we said earlier and still no luck. So IDK. it is stumping me.

  10. anxo69
    Posted 8 years ago #

    hey I just tried to put it in my home.php and it worked!

  11. floatingweeds
    Posted 8 years ago #

    boober's method works for me too.
    But instead of using an <hr> tag, I use CSS to add the rule so that I can style it more freely.

    <?php the_content(__('Read more'));?>
    <div class="clearfloat border_bottom"></div>

    border-bottom:1px #e2e2e2 solid;

    *This adds a light gray thin rule below each post.
    Have it on top, dotted, thick, double, red...you can change the style as you like.

    *I am using clear:both because I have a style
    to my thumbnail images in posts.
    'Clearing' brings the rule below the thumbnail image.

    <hr> is an html tag and <hr /> is an xhtml tag. In XHTML the <hr> tag must be properly closed. I'm not sure, but I think WordPress supports XHTML?

Topic Closed

This topic has been closed to new replies.

About this Topic