function socialbutton($content) {
if(is_single()) {
$content.= '
<div class="author_info">
<h4>This post was written by <?php the_author_posts_link(); ?></h4>
<span class="author_photo"><?php echo get_avatar( get_the_author_id() , 96 ); ?></span>
<p><?php the_author(); ?> – who has written <?php the_author_posts(); ?> posts on <a href="<?php bloginfo('home'); ?>"><?php bloginfo('name'); ?></a>.</p>
<p><?php the_author_description(); ?></p>
<p class="author_email"><a href="mailto:<?php the_author_email(); ?>" title="Send an Email to the Author of this Post">Contact the author</a></p>
</div>';
}
return $content;
}add_filter ('the_content', 'socialbutton');
When I add the code above to function.php, it shows
Parse error: syntax error, unexpected T_STRING in XXXXXX on line 10
How to solve this problem?