Viewing 15 replies - 1 through 15 (of 18 total)
  • Plugin Author keesiemeijer

    (@keesiemeijer)

    Hello tactics,

    Can you post a link to a page where this is happening.

    Thread Starter tactics

    (@tactics)

    Note: should be “nbsp” between the quotes above

    Thread Starter tactics

    (@tactics)

    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…

    https://violetweddings.com/wedding-styles/classic-fifth-avenue/

    Plugin Author keesiemeijer

    (@keesiemeijer)

    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

    (@tactics)

    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

    (@keesiemeijer)

    Can you show me the code you used in the excerpt template from this topic.
    https://www.ads-software.com/support/topic/display-thumbnail-title-and-excerpt?replies=4&view=all

    Thread Starter tactics

    (@tactics)

    <?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

    (@keesiemeijer)

    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

    (@tactics)

    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

    (@keesiemeijer)

    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

    (@tactics)

    When I do that, the widget doesn’t show up at all.

    Plugin Author keesiemeijer

    (@keesiemeijer)

    Check if the widget is in the Aside Widget sidebar at wp-admin > Appearance > Widgets.

    Thread Starter tactics

    (@tactics)

    It is. And as you can see, now nothing shows up on the page.

    Plugin Author keesiemeijer

    (@keesiemeijer)

    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

    (@tactics)

    Yes, but it still has the white space.

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘Plugin inserting " "s before excerpts’ is closed to new replies.