Title: Plugin inserting &quot;&nbsp;&quot;s before excerpts
Last modified: August 30, 2016

---

# Plugin inserting " "s before excerpts

 *  Resolved [tactics](https://wordpress.org/support/users/tactics/)
 * (@tactics)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/plugin-inserting-nbsps-before-excerpts/)
 * I’m seeing some weird behavior with this plugin. It’s adding random ” “s before
   my posts excerpts, which is creating white-space. Sometimes it’s one, sometimes
   it’s none, and sometimes it’s four. When I click on the permalink and go to the
   full-post, the ” “‘s aren’t there.
 * ?
 * [https://wordpress.org/plugins/related-posts-by-taxonomy/](https://wordpress.org/plugins/related-posts-by-taxonomy/)

Viewing 15 replies - 1 through 15 (of 18 total)

1 [2](https://wordpress.org/support/topic/plugin-inserting-nbsps-before-excerpts/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/plugin-inserting-nbsps-before-excerpts/page/2/?output_format=md)

 *  Plugin Author [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/plugin-inserting-nbsps-before-excerpts/#post-6553557)
 * Hello tactics,
 * Can you post a link to a page where this is happening.
 *  Thread Starter [tactics](https://wordpress.org/support/users/tactics/)
 * (@tactics)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/plugin-inserting-nbsps-before-excerpts/#post-6553564)
 * Note: should be “nbsp” between the quotes above
 *  Thread Starter [tactics](https://wordpress.org/support/users/tactics/)
 * (@tactics)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/plugin-inserting-nbsps-before-excerpts/#post-6553566)
 * Yep. Scroll down to the bottom of the page. The first post has one, the second
   has four, the last one has none. Completely random…
 * [http://violetweddings.com/wedding-styles/classic-fifth-avenue/](http://violetweddings.com/wedding-styles/classic-fifth-avenue/)
 *  Plugin Author [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/plugin-inserting-nbsps-before-excerpts/#post-6553569)
 * So these are images and text you’ve put in the excerpt field when editing or 
   publishing a post? Or do you add the images some other way?
 *  Thread Starter [tactics](https://wordpress.org/support/users/tactics/)
 * (@tactics)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/plugin-inserting-nbsps-before-excerpts/#post-6553580)
 * I’m not manually creating an excerpt. These are the excerpts that wordpress automatically
   generates from the first few words in the post.
 *  Plugin Author [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/plugin-inserting-nbsps-before-excerpts/#post-6553586)
 * Can you show me the code you used in the excerpt template from this topic.
    [https://wordpress.org/support/topic/display-thumbnail-title-and-excerpt?replies=4&view=all](https://wordpress.org/support/topic/display-thumbnail-title-and-excerpt?replies=4&view=all)
 *  Thread Starter [tactics](https://wordpress.org/support/users/tactics/)
 * (@tactics)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/plugin-inserting-nbsps-before-excerpts/#post-6553590)
 *     ```
       <?php if ( $related_posts ) : ?>
       <ul>
         <?php foreach ( $related_posts as $post ) :
       		setup_postdata( $post ); ?>
         <li>
           <?php the_post_thumbnail('thumbnail'); ?>
           <h4>
             <?php if ( get_the_title() ) the_title(); else the_ID(); ?>
           </h4>
           <?php the_excerpt(); ?>
           <a href="<?php the_permalink() ?>">Read More</a> </li>
         <?php endforeach; ?>
       </ul>
       <?php else : ?>
       <p>
         <?php _e( 'No related posts found', 'related-posts-by-taxonomy' ); ?>
       </p>
       <?php endif ?>
       <?php
       ```
   
 *  Plugin Author [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/plugin-inserting-nbsps-before-excerpts/#post-6553603)
 * Are you adding the widget in the wp-admin/customizer or with code in your theme
   template files? I’m asking because there’s something strange going on with the
   markup of the widget. It’s all wrapped in a list item.
 *     ```
       <aside class="related-posts">
       	<li id="related-posts-by-taxonomy-2" class="widget related_posts_by_taxonomy">
       		<h3>Related Blog Posts</h3>
       		<ul>
       			<li>...</li>
       			<li>...</li>
       			<li>...</li>
       		</ul>
       	</li>
       </aside>
       ```
   
 * This could be your theme’s doing, but there is no outer `<ul>` tag.
 *  Thread Starter [tactics](https://wordpress.org/support/users/tactics/)
 * (@tactics)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/plugin-inserting-nbsps-before-excerpts/#post-6553611)
 * I’m adding it using the widget. In my template:
 *     ```
       <aside class="related-posts">
       <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("Aside Widget") ) : ?>
       <?php endif; ?>
       </aside>
       ```
   
 * in my functions.php:
 *     ```
       if ( function_exists('register_sidebar') )
         register_sidebar(array(
           'name' => 'Aside Widget',
           'before_title' => '<h3>',
           'after_title' => '</h3>',
         )
       );
       ```
   
 *  Plugin Author [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/plugin-inserting-nbsps-before-excerpts/#post-6553618)
 * Can you change this:
 *     ```
       <aside class="related-posts">
       <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("Aside Widget") ) : ?>
       <?php endif; ?>
       </aside>
       ```
   
 * to
 *     ```
       <?php if ( is_active_sidebar( 'Aside Widget' ) ) : ?>
       	<aside class="related-posts">
       	<ul>
       		<?php dynamic_sidebar( 'Aside Widget' ); ?>
       	</ul>
       	</aside>
       <?php endif; ?>
       ```
   
 *  Thread Starter [tactics](https://wordpress.org/support/users/tactics/)
 * (@tactics)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/plugin-inserting-nbsps-before-excerpts/#post-6553627)
 * When I do that, the widget doesn’t show up at all.
 *  Plugin Author [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/plugin-inserting-nbsps-before-excerpts/#post-6553637)
 * Check if the widget is in the Aside Widget sidebar at wp-admin > Appearance >
   Widgets.
 *  Thread Starter [tactics](https://wordpress.org/support/users/tactics/)
 * (@tactics)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/plugin-inserting-nbsps-before-excerpts/#post-6553640)
 * It is. And as you can see, now nothing shows up on the page.
 *  Plugin Author [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/plugin-inserting-nbsps-before-excerpts/#post-6553642)
 * Does it show up if you use just this (for testing):
 *     ```
       <aside class="related-posts">
       	<ul>
       		<?php dynamic_sidebar( 'Aside Widget' ); ?>
       	</ul>
       	</aside>
       ```
   
 *  Thread Starter [tactics](https://wordpress.org/support/users/tactics/)
 * (@tactics)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/plugin-inserting-nbsps-before-excerpts/#post-6553646)
 * Yes, but it still has the white space.

Viewing 15 replies - 1 through 15 (of 18 total)

1 [2](https://wordpress.org/support/topic/plugin-inserting-nbsps-before-excerpts/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/plugin-inserting-nbsps-before-excerpts/page/2/?output_format=md)

The topic ‘Plugin inserting " "s before excerpts’ 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/)

 * 18 replies
 * 2 participants
 * Last reply from: [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * Last activity: [10 years, 8 months ago](https://wordpress.org/support/topic/plugin-inserting-nbsps-before-excerpts/page/2/#post-6553711)
 * Status: resolved