Co-Authors Plus
[resolved] Looping through each author for theme (4 posts)

  1. adam8797
    Posted 3 years ago #

    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>
    			<?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.


  2. adam8797
    Posted 3 years ago #

    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(); ?>
    			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.

  3. boxcarpress
    Posted 3 years ago #

    PHP uses "." to concatenate strings, not a "+". You're doing some addition where you mean to concatenate the <span> to the_author_posts_link(). :)

  4. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 3 years ago #

    Thanks boxcarpress!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Co-Authors Plus
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.