Forums

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

  1. DaoByDesign
    Member
    Posted 8 months 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 8 months 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. DaoByDesign
    Member
    Posted 8 months 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 5 months 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 5 months 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 1 month 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.

Reply

You must log in to post.

About this Topic