Title: Author Code broken?
Last modified: March 16, 2018

---

# Author Code broken?

 *  [MitchellAU](https://wordpress.org/support/users/mitchellau/)
 * (@mitchellau)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/author-code-broken/)
 * I’ve created a filter for the author info to pull a guest author from custom 
   fields.
 *     ```
       function fb_guest_author($author,$post_id){
   
       	global $post;
       	//global $author;
   
       	   $post = get_post($post_id);
       	   $author = get_post_meta($post->ID, 'guest_author', true);
       	   return $author;
       }
   
       add_filter( 'afbia_author', 'fb_guest_author', 10,2);
       ```
   
 * The function works but the resulting Instant Article code is garbled e.g
 *     ```
       <address>
       <a gordon="" gregory data-wpel-link="internal">
       </a>
       </address>
       ```
   
 * I’ve had a look at the code in instant_article.php around line 140 where the 
   <address> code is but can’t work out why it’s not parsing correctly. The only
   way I can get it to work is replace the whole code block with
 *     ```
       <address>
       <a><?php echo esc_html($author); ?></a></address>
       ```
   
 * Any ideas and to what would cause this?

The topic ‘Author Code broken?’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/allfacebook-instant-articles_cdcdc1.
   svg)
 * [WordPress Instant Articles by allfacebook.de](https://wordpress.org/plugins/allfacebook-instant-articles/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/allfacebook-instant-articles/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/allfacebook-instant-articles/)
 * [Active Topics](https://wordpress.org/support/plugin/allfacebook-instant-articles/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/allfacebook-instant-articles/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/allfacebook-instant-articles/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [MitchellAU](https://wordpress.org/support/users/mitchellau/)
 * Last activity: [8 years, 2 months ago](https://wordpress.org/support/topic/author-code-broken/)
 * Status: not resolved