Title: Issues with Spacing and Code
Last modified: August 30, 2016

---

# Issues with Spacing and Code

 *  Resolved [grungyape](https://wordpress.org/support/users/grungyape/)
 * (@grungyape)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/issues-with-spacing-and-code/)
 * My issue is with readability. The shortcodes appear to add spacing to the output
   HTML when added to your page code like this:
 *     ```
       [accordion tag="p" clicktoclose="true" autoclose="true"]
       [accordion-item class="cfstyle" title="3-Way Call Transfer"]3-Way Call Transfer allows the subscriber to add a third party to an existing call without operator assistance. With 3-Way Call Transfer, a subscriber can set up a 3-way call and then disconnect, allowing the remaining parties to continue the conversation.[/accordion-item]
       [accordion-item class="cfstyle" title="3-Way Calling"]Allows you to add a third party to your current telephone conversation. This feature can reduce the need for callbacks when organizing plans and schedules. 3-Way Calling can bring family and friends together.[/accordion-item]
       [accordion-item class="cfstyle" title="Anonymous Call Rejection"]By dialing a simple code, you can program your phone to refuse calls from callers which have blocked their number. Those callers get a special message which says you do not accept anonymous calls and suggests they remove the blocking and call again. See instructions below. All other callers ring through as usual.[/accordion-item]
       [/accordion]
       ```
   
 * As a result, I seem forced to write my code as follows to avoid it:
 * `[accordion tag="p" clicktoclose="true" autoclose="true"][accordion-item class
   ="cfstyle" title="3-Way Call Transfer"]3-Way Call Transfer allows the subscriber
   to add a third party to an existing call without operator assistance. With 3-
   Way Call Transfer, a subscriber can set up a 3-way call and then disconnect, 
   allowing the remaining parties to continue the conversation.[/accordion-item][
   accordion-item class="cfstyle" title="3-Way Calling"]Allows you to add a third
   party to your current telephone conversation. This feature can reduce the need
   for callbacks when organizing plans and schedules. 3-Way Calling can bring family
   and friends together.[/accordion-item][accordion-item class="cfstyle" title="
   Anonymous Call Rejection"]By dialing a simple code, you can program your phone
   to refuse calls from callers which have blocked their number. Those callers get
   a special message which says you do not accept anonymous calls and suggests they
   remove the blocking and call again. See instructions below. All other callers
   ring through as usual.[/accordion-item][/accordion]`
 * This is very hard to read and make sense of. Any way to avoid the addition of
   the spacing when separated out?
 * [https://wordpress.org/plugins/accordion-shortcodes/](https://wordpress.org/plugins/accordion-shortcodes/)

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

 *  Thread Starter [grungyape](https://wordpress.org/support/users/grungyape/)
 * (@grungyape)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/issues-with-spacing-and-code/#post-6287697)
 * Sorry, the site is still currently internal, so I am unable to link it. I’m also
   not sure why my second block did not appear as code, I must have deleted a tick
   by mistake.
 *  Thread Starter [grungyape](https://wordpress.org/support/users/grungyape/)
 * (@grungyape)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/issues-with-spacing-and-code/#post-6287702)
 * I suck, might help if I noticed that this page had wpautop enabled, when I thought
   it was turned off everywhere.
 *  Plugin Author [philbuchanan](https://wordpress.org/support/users/philbuchanan/)
 * (@philbuchanan)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/issues-with-spacing-and-code/#post-6287774)
 * I like to use this function in my `functions.php` file to solve the `wpautop`
   shortcode output issues:
 *     ```
       /**
        * Fixes empty <p> and <br> tags showing before and after shortcodes in the
        * output content.
        */
       function pb_the_content_shortcode_fix($content) {
       	$array = array(
       		'<p>['    => '[',
       		']</p>'   => ']',
       		']<br />' => ']',
       		']<br>'   => ']'
       	);
   
       	return strtr($content, $array);
       }
       add_filter('the_content', 'pb_the_content_shortcode_fix');
       ```
   
 *  Thread Starter [grungyape](https://wordpress.org/support/users/grungyape/)
 * (@grungyape)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/issues-with-spacing-and-code/#post-6287869)
 * Phil, thank you.

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

The topic ‘Issues with Spacing and Code’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/accordion-shortcodes.svg)
 * [Accordion Shortcodes](https://wordpress.org/plugins/accordion-shortcodes/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/accordion-shortcodes/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/accordion-shortcodes/)
 * [Active Topics](https://wordpress.org/support/plugin/accordion-shortcodes/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/accordion-shortcodes/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/accordion-shortcodes/reviews/)

## Tags

 * [spacing issue](https://wordpress.org/support/topic-tag/spacing-issue/)

 * 4 replies
 * 2 participants
 * Last reply from: [grungyape](https://wordpress.org/support/users/grungyape/)
 * Last activity: [10 years, 11 months ago](https://wordpress.org/support/topic/issues-with-spacing-and-code/#post-6287869)
 * Status: resolved