Forums

Advanced Excerpt
[resolved] A desperate plea- Advanced Excerpt not working with WP update? (7 posts)

  1. cdorfmandance
    Member
    Posted 5 months ago #

    Just updated to the new WP, and now one of our pages is not working. The page is our schedule of events, with each event being a post.

    I am getting the following error: Fatal error: Call to a member function filter() on a non-object in /home/cdorfmandance/cddc.info/wp-content/themes/cddc/page-schedule.php on line 15

    I'm assuming that this error is being caused by Advanced Excerpt, since that's the only filter I can find in the page template.

    I'm incredibly new to CSS, and have no idea what to do about this. The site and theme were created way before my time at the company.

    We really need to get this page up and running, does anyone know what I should do? I already tried deactivating the plugin without success, but I still think it's a problem in the template related to the plugin settings.

    http://wordpress.org/extend/plugins/advanced-excerpt/

  2. basvd
    Member
    Posted 5 months ago #

    I am assuming you are using the latest versions of WordPress and the plugin, as well as PHP 5.

    I can not reproduce this bug based on the code of the plugin. So my guess is that the theme is the culprit here. The code in the file page-schedule.php is probably something like: $advancedexcerpt->filter() which is how the plugin used to work internally.

    However, the method filter should never be called directly. For theming purposes, there is the_advanced_excerpt function. You can check the plugin FAQ for instructions on how to use it.

    If you can't figure it out, post a snippet of code around the line of the error and I'll see if I can provide a working alternative.

  3. cdorfmandance
    Member
    Posted 5 months ago #

    Everything is the latest version, and I think you may be right about the theme being the issue. I have contacted the developer, but since he built the site for my predecessor's predecessor, I'm not sure if I'll get a response. Here's the code that I think is causing the problem:

    <div class="column span-14 schedule">
    	<?php query_posts('category_name=schedule'); ?>
    		<?php while (have_posts()) : the_post(); ?>
    		<h2 class="schedule"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
    		<div class="schedule-entry">
           <?php $advancedexcerpt->filter(the_content(),20, 1, null, array('a', 'strong')) ?>
        </div><div id="schedule-footer">&nbsp;</div></strong>

    So, are you saying that instead of using "$advancedexcerpt...", it should instead read "the_advanced_excerpt('length=x&use_words=1&...)"?

    Thanks a bunch, I'm about to send out a newsletter reminding people to check our schedule, so this is definitely a priority!

  4. basvd
    Member
    Posted 5 months ago #

    Exactly!
    You can replace this line:
    <?php $advancedexcerpt->filter(the_content(),20, 1, null, array('a', 'strong')) ?>
    with
    <?php the_advanced_excerpt('length=20&use_words=1&allowed_tags=a,strong'); ?>

  5. cdorfmandance
    Member
    Posted 5 months ago #

    Thank you, thank you, thank you! I knew it had to be a simple fix.

  6. cdorfmandance
    Member
    Posted 5 months ago #

    One more thing- is there a way to get rid of the ellipses? It looks odd in the context of the page.

  7. basvd
    Member
    Posted 5 months ago #

    Sure, just add &ellipsis= (nothing after =) to the string of options.

Reply

You must log in to post.

About this Plugin

About this Topic