• Hello,

    Under “Customise the list HTML” there’s options for before list, before item, after item and after list. What I’m trying to do is add HTML in between items, for example a <hr> tag but any edits I make to top10.php seems to only apply my code to every item and not between the items. The site isn’t currently live but here’s a screenshot.

    View post on imgur.com

    Any help would be great.

    https://ww.wp.xz.cn/plugins/top-10/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Ajay

    (@ajay)

    You could try to put the <hr> tag to the after the list of posts?

    Thread Starter rickykpg

    (@rickykpg)

    Hello,

    I created a div class for my code and placed it here.

    if ( $disp_list_count ) $output .= ' <span class="tptn_list_count">(' . number_format_i18n( $sumcount ) . ')</span><div class="hr">';

    It works but what I’m trying to do is get it so the line only shows up between items and not after the last one. You can see it in effect in the image below. I’m trying to get it so the line doesn’t show up after “Video Post Example”.

    View post on imgur.com

    Plugin Author Ajay

    (@ajay)

    Editing the plugin isn’t a good idea since it doesn’t make it upgrade proof.

    The place you’ve put the code is within the loop which is why you see it repeating.

    Is there a reason you can’t put the <div class="hr"> in the “After the list of posts” option under Output options?

    Thread Starter rickykpg

    (@rickykpg)

    Hello,

    I tried that initially, only shows up once after the last item.

    Plugin Author Ajay

    (@ajay)

    I understand now. I was suggesting the other way around.

    Instead of using the <div> you should consider using CSS to directly style the lists.

    Check out this post that gives you an idea of how to do it between list items.

    http://www.jackreichert.com/2011/07/31/how-to-add-a-divider-between-menu-items-in-css-using-only-one-selector/

    e.g. this code (not tested)

    .tptn_related ul li { border-bottom: 1px solid #000000 }
    .tptn_related ul li:last { border-bottom: none }
    Thread Starter rickykpg

    (@rickykpg)

    Hello,

    Thank you for the link and example code, sadly I was unable to get it to work so for the time being I’ll have to do with the line at the bottom until I can get someone else to take a look.

    Plugin Author Ajay

    (@ajay)

    No issues. The best option is to get hold of some CSS expert who can best guide you on how to get rid of the line.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Custom Code Between Items’ is closed to new replies.