• zilla4

    (@zilla4)


    Hi,

    I want to have a simple <hr /> after each link in my bookmarks but I can’t figure out how to set the code up.

    I’m just using the default template:

    <?php wp_list_bookmarks(); ?>

    I did find this link https://codex.www.ads-software.com/Template_Tags/wp_list_bookmarks but am not very good with php and couldn’t figure it out…

    can anyone give me some advice or point me to a post?

    thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • stvwlf

    (@stvwlf)

    Hi

    You can try this
    wp_list_bookmarks('after=</li><hr />')

    Its intended to output an <hr /> after each closing </li>

    There is also a “before” which you can add code to. The default for before is <li> and the default for after is </li> which is why they don’t need to be there if that is all you want.

    You can add any HTML tags you want, including<div> or <span> in case you need them to do some CSS styling.

    If you use more than one parameter, separate them with &

    wp_list_bookmarks('before=<li class="myclass">&after=</li><hr />')

    t31os

    (@t31os)

    Is it XHTML compliant to the HR outside the closing LI?

    stvwlf

    (@stvwlf)

    hr is a block element so it can’t go inside the li. But you are correct, it isn’t correct to put it after the li either.

    A better way to do this would be to not use hr but to put a bottom border on the li and add bottom-padding to create space between the bottom of the list text and the border

    Thread Starter zilla4

    (@zilla4)

    thanks for the help! worked a treat!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘wp_list_bookmarks formatted with <hr />’ is closed to new replies.