WordPress.org

Ready to get started?Download WordPress

Forums

Trying to put a line between post (11 posts)

  1. anxo69
    Member
    Posted 6 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; ?>

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

    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.

    Thanks

  2. Jaap
    Member
    Posted 6 years ago #

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

  3. Jaap
    Member
    Posted 6 years ago #

    Sorry don't forget i read it like /hr

  4. boober
    Member
    Posted 6 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
    Member
    Posted 6 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
    Member
    Posted 6 years ago #

    try

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

    nope no go.

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

  8. carlscape101
    Member
    Posted 6 years ago #

    just wondering why the <hr />

    Why not just <hr>

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

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

    But since i'm dumb :)
    This might help:
    http://wordpress.org/support/topic/136220?replies=4

  9. anxo69
    Member
    Posted 6 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
    Member
    Posted 6 years ago #

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

  11. floatingweeds
    Member
    Posted 6 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.

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

    [CSS]
    .clearfloat{
    clear:both;
    }
    .border_bottom{
    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
    img{float:left}
    to my thumbnail images in posts.
    'Clearing' brings the rule below the thumbnail image.

    >carlscape101
    <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

Tags