WordPress.org

Ready to get started?Download WordPress

Forums

Add a line break in Recent Entires List (5 posts)

  1. trash-spam
    Member
    Posted 4 years ago #

    All

    Hello.

    I just want to add in a line break between each entry in the list that this code outputs - which is the last 10 entries.

    <!-- RECENT ENTRIES -->
    <?php if (function_exists('wp_get_archives')) { ?>
    <li id="recent-entries"><h3>Recent Entries ::</h3>

      <?php wp_get_archives('type=postbypost&limit=10&format=&nbsp&before=
    • &after=
    • '); ?>

    <li class="dotted_line"> 
    <?php } ?>

    Any input really appreciated.

    Thanks

    Ray

  2. curlybracket
    Member
    Posted 4 years ago #

    http://codex.wordpress.org/Function_Reference/wp_get_archives
    You should probably use something like : &after=

    But please be aware that this is crappy. It is better to add space or lines or background images using CSS not adding line breaks and HTML code.

  3. trash-spam
    Member
    Posted 4 years ago #

    Thanks Veganist

    Think this is beyond my capabilities - so have just deleted the list of latest entries

    Ray

  4. Antanarive
    Member
    Posted 4 years ago #

    It is not so complicated if you know how to add some lines in the CSS of your theme.

    From the code you pasted above, it seems that the recent posts list is a sub-unordered list with id equal to recent-entries. Therefore, what you want to modify in CSS is the space between <li> elements that are within a <li id="recent-entries"> element.

    Adding space between li elements can be done by specifying some increased bottom margin.

    So, in total, we would have something like:

    #recent-entries li {
    	margin-bottom: 1em;
    }
  5. Antanarive
    Member
    Posted 4 years ago #

    It is not so complicated if you know how to add some lines in the CSS of your theme.

    From the code you pasted above, it seems that the recent posts list is a sub-unordered list with id equal to recent-entries. Therefore, what you want to modify in CSS is the space between <li> elements that are within a <li id="recent-entries"> element.

    Adding space between li elements can be done by specifying some increased bottom margin.

    So, in total, we would have something like:

    #recent-entries li {
    	margin-bottom: 1em;
    }

    Add this to your CSS file. This will only adjust the list of recent posts. I can't believe mayself it is so simple! :-)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags