WordPress.org

Forums

Co-Authors Plus
[resolved] Error after updating (3 posts)

  1. paologanino
    Member
    Posted 4 years ago #

    After updating from 2.1.1 to 2.5.1 i get this error on my posts:

    Fatal error: Class 'CoAuthorsIterator' not found in single.php on line 143

    I have an author box on my posts and i am using an iterator to show coauthors.

    Any help please?

    This is my code

    <?php $i = new CoAuthorsIterator(); ?>
    <div id="about_the_author">
    <div class="header"><h5>Autore</h5></div>
    							<hr/>
    <?php while($i->iterate()){ ?>
    <div class="thumb">
    <?php echo get_avatar( get_the_author_meta('user_email'), '100', '' ); ?>
    </div>
    <div class="description">
    <strong><?php the_author_posts_link(); ?></strong><br/>
    </div>
    <div class="description">
    <p><?php the_author_meta('description'); ?></p></div>
    <?php } ?>

    http://wordpress.org/extend/plugins/co-authors-plus/

  2. paologanino
    Member
    Posted 4 years ago #

    solved! the plugin had automatically been deactivated after the upgrade

  3. Mohammad Jangda
    Member
    Plugin Author

    Posted 3 years ago #

    It's always a good idea to use things like function_exists and class_exists when using code from external plugins. In your case, something like:

    if( class_exists( 'CoAuthorsIterator' ) ) {
        $i = new CoAuthorsIterator();
        // rest of your code
    } else {
        // add a fallback here
    }

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic