Title: Adding horizontal rule element
Last modified: March 3, 2017

---

# Adding horizontal rule element

 *  Resolved [jrcollins](https://wordpress.org/support/users/jrcollins/)
 * (@jrcollins)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/adding-horizontal-rule-element/)
 * I’m trying to add `<hr>` before the plugin output using the defaults filter.
   
   This is the code I’m using:
 *     ```
       add_filter( 'related_posts_by_taxonomy_shortcode_defaults', 'related_shortcode_before' );
       function related_shortcode_before( $defaults ) {
           $defaults['before_shortcode'] = '<hr>';
           return $defaults;
       }
       ```
   
 * The horizontal rule is showing but it breaks the layout of the page.
    -  This topic was modified 9 years, 3 months ago by [jrcollins](https://wordpress.org/support/users/jrcollins/).

Viewing 1 replies (of 1 total)

 *  Plugin Author [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/adding-horizontal-rule-element/#post-8872376)
 * Hi [@jrcollins](https://wordpress.org/support/users/jrcollins/)
 * It’s because the `after_shortcode` attribute still has a closing div.
 * Try this:
 *     ```
       add_filter( 'related_posts_by_taxonomy_shortcode_defaults', 'related_shortcode_before' );
       function related_shortcode_before( $defaults ) {
           $defaults['before_shortcode'] = '<hr>';
           $defaults['after_shortcode'] = '';
           return $defaults;
       }
       ```
   
 * Or this:
 *     ```
       add_filter( 'related_posts_by_taxonomy_shortcode_defaults', 'related_shortcode_before' );
       function related_shortcode_before( $defaults ) {
           $defaults['before_shortcode'] = '<hr><div class="rpbt_shortcode">';
           return $defaults;
       }
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Adding horizontal rule element’ is closed to new replies.

 * ![](https://ps.w.org/related-posts-by-taxonomy/assets/icon.svg?rev=1115231)
 * [Related Posts by Taxonomy](https://wordpress.org/plugins/related-posts-by-taxonomy/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/related-posts-by-taxonomy/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/related-posts-by-taxonomy/)
 * [Active Topics](https://wordpress.org/support/plugin/related-posts-by-taxonomy/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/related-posts-by-taxonomy/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/related-posts-by-taxonomy/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * Last activity: [9 years, 3 months ago](https://wordpress.org/support/topic/adding-horizontal-rule-element/#post-8872376)
 * Status: resolved