WordPress.org

Forums

[resolved] Adding <hr /> between posts (finding the right location) (7 posts)

  1. HYP
    Member
    Posted 7 years ago #

    Using these threads: 1, 2, 3, 4 ... I sort of found out how to put the <hr /> between posts, but I just need one little bit of help: it's not showing up for every post.

    It's because I just put it in right inside the Tags to the end of my posts (I got the idea from here) in The Loop. But it'll only show up for posts that have Tags. No tags, no horizontal line.

    I tried randomly putting the <hr /> elsewhere in Regulus's (the blog's theme) The Loop, but that didn't work hehe.

    So can someone kindly help me out find where is the correct line to place the <hr /> in Regulus? Thanks.

    ----

    Sort of related (but depending on the mod's answers I might start a new thread for this question): I want to style the Tags' line, but I dunno what is the code that does into the CSS, suggestions?

  2. Kafkaesqui

    Posted 7 years ago #

    Someone would have to force me into the Regulus source...

    If your index.php hasn't been modified too much, you should find these lines in that mass of PHP code:

    echo "<!--";
    trackback_rdf();
    echo "-->";

    Just add this *right* under it:

    ?>
    <hr />
    <?php

    --------------------
    RE: Tags

    That would completely depend on you. Tags are not displayed with any inbuilt class, so you would need to assign one.

  3. HYP
    Member
    Posted 7 years ago #

    Very cool Kafka, that works for me, thanks!

    As for the RE: Tags part, I assigned the class like so:

    "<div id=tags>";
    the_tags('<br />stored in: ', ', ', '<br /><br />');
    "</div>";

    and in the CSS I put in this:

    #tags {
    color:#fff;
    font-style:italic;
    }

    I thought that would take care of things, but I'm doing something bad in the assigning part. And the "quotes" part is weird in that, without it, wordpress says there's a problem (I'm using another div class near the end of the index.php as a reference for doing this Tag id, that's why)

    (And hah @Regulus theme... It's bad huh? I had no idea, it's my first blog and that was just the first one I picked)

  4. Kafkaesqui

    Posted 7 years ago #

    Try this in index.php:

    the_tags('<div class="tags">stored in: ', ', ', '</div>');

    Note I removed the <br /> tags because for one you can style in padding to accomplish what they provide, and for another their existence outside a paragraph element is invalid XHTML.

    I also changed the id attribute to a class -- this is because you can have multiple posts on a page each displaying tags, whereas the id should be a unique identifier on a page. So make sure to change your #tags declaration in your css to a .tags one.

    And no, Regulus is not really a bad theme, just one which sort of acts as a transition from pre-WordPress 1.5 way of styling ones blog (when we had no built-in template hierarchy and management). And can, as you're learning, be difficult to customize when you do not know exactly how PHP works.

    Finally, call me Kaf.

  5. MichaelH
    Member
    Posted 7 years ago #

    I've wondered, is that Kaf as in cough or Kaf as in caffeine?

    :)

  6. HYP
    Member
    Posted 7 years ago #

    Kaf, yup that did it! And thanks for the explanation as well, since it'll surely help out for future things/problems I run into and know about these rules.

    Hah, I should totally just start over with a new theme to avoid head scratches with Regulus.

    I'm leaning towards pronouncing your name as 'caffeine' because I'm sure being a mod isn't easy! ;)

  7. Kafkaesqui

    Posted 7 years ago #

    I also provide support on the name. ;)

Topic Closed

This topic has been closed to new replies.

About this Topic