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