Support » Themes and Templates » Add a line break in Recent Entires List

  • 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

Viewing 4 replies - 1 through 4 (of 4 total)
  • 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.

    Thanks Veganist

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

    Ray

    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;
    }

    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! 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Add a line break in Recent Entires List’ is closed to new replies.