Title: Custom Fields example code not working
Last modified: November 12, 2020

---

# Custom Fields example code not working

 *  Resolved [cmarius](https://wordpress.org/support/users/cmarius/)
 * (@cmarius)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/custom-fields-367/)
 * Hey guys,
 * I’m interested in adding some extra data in the json feed, but the snippet example
   does not work:
 *     ```
       function wp_custom_json_feed_fields( $feed_item, $post ){
       	$feed_item[‘author’][‘archive_link’] = get_author_posts_url( $post->post_author );
       	return $feed_item;
       }
       add_filter( ‘json_feed_item’, ‘wp_custom_json_feed_fields’, 10, 2);
       ```
   
 * I’ve added the above at the end of my theme’s functions.php file, and there are
   no changes.
    EDIT: changing the quotes from ‘ to ‘ or ” seems to have fixed it!
    -  This topic was modified 5 years, 6 months ago by [cmarius](https://wordpress.org/support/users/cmarius/).
    -  This topic was modified 5 years, 6 months ago by [cmarius](https://wordpress.org/support/users/cmarius/).
    -  This topic was modified 5 years, 6 months ago by [cmarius](https://wordpress.org/support/users/cmarius/).
    -  This topic was modified 5 years, 6 months ago by [cmarius](https://wordpress.org/support/users/cmarius/).
    -  This topic was modified 5 years, 6 months ago by [cmarius](https://wordpress.org/support/users/cmarius/).
    -  This topic was modified 5 years, 6 months ago by [cmarius](https://wordpress.org/support/users/cmarius/).

The topic ‘Custom Fields example code not working’ is closed to new replies.

 * ![](https://ps.w.org/jsonfeed/assets/icon-256x256.png?rev=2985651)
 * [JSON Feed (jsonfeed.org)](https://wordpress.org/plugins/jsonfeed/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/jsonfeed/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/jsonfeed/)
 * [Active Topics](https://wordpress.org/support/plugin/jsonfeed/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/jsonfeed/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/jsonfeed/reviews/)

## Tags

 * [custom_fields](https://wordpress.org/support/topic-tag/custom_fields/)

 * 0 replies
 * 1 participant
 * Last reply from: [cmarius](https://wordpress.org/support/users/cmarius/)
 * Last activity: [5 years, 6 months ago](https://wordpress.org/support/topic/custom-fields-367/)
 * Status: resolved