WordPress.org

Forums

Advanced Excerpt Template Tag not doing its job (13 posts)

  1. Ryan
    Member
    Posted 6 years ago #

    Hi, first - fantastic plugin. I've used it on several sites without a hitch and absolutely love it.

    On a recent site I had the Advanced Excerpt working beautifully utilizing the the_advanced_excerpt() template tag to control excerpts of various lengths for several different sections.

    I then moved the site to a new server, and though everything is still functioning without noticeable errors, the the_advanced_excerpt() has stopped overriding the default settings set in the SETTINGS->EXCERPT area.

    I can't think of anything that would cause this in moving to a new server, but am hoping maybe someone (Bas?) may be able to point me in the right direction.

  2. basvd
    Member
    Posted 6 years ago #

    I have no idea why this is happening, unfortunately. The plugin code is pretty straightforward as far as overriding settings goes (it actually uses the exact same method of overriding default settings as any WP template tag does).

    Have you tried re-applying the Excerpt settings and/or re-installing the plugin?

  3. Ryan
    Member
    Posted 6 years ago #

    Thanks for the quick reply Bas.

    I've reinstalled the plugin, and then also re-copied all the core WP files just to make sure nothing was missing or corrupted - everything is working fine but this. Very bizarre.

    Adding to the weirdness is the fact that the override is functioning as intended on every other post. So, using the following code, I generate 6 posts:

    <?php query_posts('showposts=6&offset=0'); ?>
    <?php while (have_posts()) : the_post(); ?>
    	<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
    		<h1><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h1>
    		<?php bdw_get_fpimg($post->ID); ?>
    		<div class="entry">
    			<?php the_advanced_excerpt('length=80&use_words=0&no_custom=1&ellipsis=%26hellip;&exclude_tags=img,p,strong'); ?>
    			<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>" class="read-more">read more</a>
    		</div>
    	</div>
    <?php endwhile; ?>

    You can see the result at http://openkyoto.com

    Post 1: the_advanced_excerpt template tag override works
    Post 2: doesn't work, but advanced_excerpt's default settings are used
    Post 3: works
    Post 4: doesn't work
    Post 5: works
    Post 6: doesn't work

    You can see this behavior repeats in the center column on the site as well. Even if I remove the center column (in case multiple query_posts calls were causing the problem) the result is the same.

    Any ideas?

  4. colintemple
    Member
    Posted 6 years ago #

    I'm having a similar problem -- the_advanced_excerpt is not allowing me to override default settings. It doesn't alternate for me, though -- it never works.

  5. colintemple
    Member
    Posted 6 years ago #

    Ok, I found out what's happening for me, at least. My problem was specifically with the allowed/excluded tags not being overidden.

    On line 333 of Advanced Excerpt 0.2.2, you have this:

    $allow_tags = $advancedexcerpt->array_complement($allow_tags, $exclude_tags);

    But $advancedexcerpt->array_complement doesn't return anything, so the allowed tags gets erased before the filter function is called.

    Adding return $c; to the end of that function fixed it for me.

  6. basvd
    Member
    Posted 5 years ago #

    Thanks for the heads-up. I don't know why I forgot to include that line in the code, because it's actually a crucial part of that rather simple function.
    The fix will be included in an update which I hope will be completed soon.

    Sorry for the late reply, by the way.

  7. Philip
    Member
    Posted 5 years ago #

    I'm curious if this update was ever completed?

  8. Philip
    Member
    Posted 5 years ago #

    I ask because I just had to perform this fix myself. It's not difficult, but it took me forever to track down the problem.

  9. basvd
    Member
    Posted 5 years ago #

    An update is out now. This problem (among others) has been fixed.

  10. diniscorreia
    Member
    Posted 5 years ago #

    Hi Bas,

    I'm using the latest version and I'm having issues with the template tag - the allowed_tags parameter doesn't work (all the markup is removed); if I set the exclude_tags parameter, only the tags I set are excluded but the lenght isn't working (it just the whole content).

    Any ideias?
    Thanks - great plugin!

  11. diniscorreia
    Member
    Posted 5 years ago #

    And it gets weirder :) Apparently, the post lenght is only counting characters/word on the first paragraph.

  12. Matt Oettinger
    Member
    Posted 5 years ago #

    I'm having the same issue here. Allowed tags does not work. Will there be a fix for this soon?

  13. Seijun
    Member
    Posted 5 years ago #

    Im having a problem where for some reason advanced excerpt only allows me to use up to 53 words when i am using thumbnails for excerpts. If thumbnails is deactivated, it works.

Topic Closed

This topic has been closed to new replies.

About this Topic