Support » Plugin: Co-Authors Plus » [Plugin: Co-Authors Plus] Looping through each author for theme

  • Resolved adam8797

    (@adam8797)


    This is the author block that my theme provides:

    <?php if (option::get('post_authorbio') == 'on') { ?>
    				<div class="post_author">
    					<?php echo get_avatar( get_the_author_meta('ID') , 70 ); ?>
    					<span><?php _e('Author:', 'wpzoom'); ?> <?php the_author_posts_link(); ?></span>
    					<?php the_author_meta('description'); ?><div class="clear"></div>
    				</div>
    			<?php } ?>

    I have been trying for a while and all I end up with are 500 Errors….. I dont know PHP at all.

    Any help would be appreciated. All I need to do is repeat that div for each author.

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • ok, so i figured it out but I have a problem

    Here is the code

    <?php if (option::get('post_authorbio') == 'on') { ?>
    	<?php $i = new CoAuthorsIterator(); ?>
    	<?php
    		while($i->iterate()){
    			print "<div class='post_author'>";
    			print get_avatar( get_the_author_meta('ID') , 70 );
    			print "<span>" + _e('Author:', 'wpzoom') + "HELLO THERE" + the_author_posts_link() + "</span>";
    			print the_author_meta('description');
    			print "<div class='clear'></div></div>";
    		} ?>
    <?php } ?>

    which works fine, but adds a zero to the end of each name.
    Produces: http://imgur.com/TegPI

    This one has got me stumped.

    PHP uses “.” to concatenate strings, not a “+”. You’re doing some addition where you mean to concatenate the <span> to the_author_posts_link(). 🙂

    Plugin Author Daniel Bachhuber

    (@danielbachhuber)

    Thanks boxcarpress!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Co-Authors Plus] Looping through each author for theme’ is closed to new replies.