Title: Custom Code Between Items
Last modified: August 21, 2016

---

# Custom Code Between Items

 *  [rickykpg](https://wordpress.org/support/users/rickykpg/)
 * (@rickykpg)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/custom-code-between-items/)
 * 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](https://imgur.com/uXOwlRc)
 * Any help would be great.
 * [https://wordpress.org/plugins/top-10/](https://wordpress.org/plugins/top-10/)

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

 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/custom-code-between-items/#post-5033411)
 * You could try to put the `<hr>` tag to the after the list of posts?
 *  Thread Starter [rickykpg](https://wordpress.org/support/users/rickykpg/)
 * (@rickykpg)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/custom-code-between-items/#post-5033418)
 * 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](https://imgur.com/gzabDU8)
 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/custom-code-between-items/#post-5033439)
 * 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](https://wordpress.org/support/users/rickykpg/)
 * (@rickykpg)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/custom-code-between-items/#post-5033443)
 * Hello,
 * I tried that initially, only shows up once after the last item.
 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/custom-code-between-items/#post-5033462)
 * 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/](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](https://wordpress.org/support/users/rickykpg/)
 * (@rickykpg)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/custom-code-between-items/#post-5033474)
 * 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](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/custom-code-between-items/#post-5033475)
 * 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.

 * ![](https://ps.w.org/top-10/assets/icon-256x256.png?rev=2986432)
 * [WebberZone Top 10 — Popular Posts](https://wordpress.org/plugins/top-10/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/top-10/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/top-10/)
 * [Active Topics](https://wordpress.org/support/plugin/top-10/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/top-10/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/top-10/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [Ajay](https://wordpress.org/support/users/ajay/)
 * Last activity: [11 years, 11 months ago](https://wordpress.org/support/topic/custom-code-between-items/#post-5033475)
 * Status: not resolved