Title: Custom Field Data
Last modified: August 21, 2019

---

# Custom Field Data

 *  [demitripagonis](https://wordpress.org/support/users/demitripagonis/)
 * (@demitripagonis)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/custom-field-data-2/)
 * I need to show data from a custom field under the post title? Is there a way 
   to do that?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/custom-field-data-2/#post-11856034)
 * You could write a function that filters [crp_title](https://github.com/WebberZone/contextual-related-posts/blob/master/includes/output-generator.php#L208)
   that will then add the data from the custom field to $title
 *  Thread Starter [demitripagonis](https://wordpress.org/support/users/demitripagonis/)
 * (@demitripagonis)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/custom-field-data-2/#post-11857075)
 * Thanks – but where would I write that code? I am using this in the template file
   via “if ( function_exists( ‘echo_crp’ ) ) { echo_crp(); }
    }” where I want the
   posts shown.
 * I assume a more manual method is needed. Is there some documentation for this?
 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/custom-field-data-2/#post-11861759)
 * You could add code like this in your theme’s functions.php – completely untested.
 *     ```
       function crp_title_filter( $title, $result, $args ) {
   
           $key_1_value = get_post_meta(  $result->ID, 'key_1', true );
   
           return $title . $key_1_value;
       }
       add_filter( 'crp_title', 'crp_title_filter', 10, 3 );
       ```
   

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Custom Field Data’ is closed to new replies.

 * ![](https://ps.w.org/contextual-related-posts/assets/icon-256x256.png?rev=2985705)
 * [Contextual Related Posts](https://wordpress.org/plugins/contextual-related-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contextual-related-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contextual-related-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/contextual-related-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contextual-related-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contextual-related-posts/reviews/)

## Tags

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

 * 3 replies
 * 2 participants
 * Last reply from: [Ajay](https://wordpress.org/support/users/ajay/)
 * Last activity: [6 years, 9 months ago](https://wordpress.org/support/topic/custom-field-data-2/#post-11861759)
 * Status: not resolved