Title: Problem displaying posts custom field value
Last modified: August 20, 2016

---

# Problem displaying posts custom field value

 *  [Sprutt](https://wordpress.org/support/users/sprutt/)
 * (@sprutt)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/problem-displaying-posts-custom-field-value/)
 * Hi all,
 * First off, I’m very new to PHP so please be patient with me.
 * What I want to do is display a custom field value right after the post title 
   on every post. The custom field is created with the help of the “Advanced custom
   fields” plugin.
 * In “CatListDisplayer.php” I’ve added some code at the end of the function “get_post_title”.
   After alot of trial and error I got it to actually get the values, but the problem
   is that they’re not displayed where the code is placed but instead the values
   for all posts are shown in a row BEFORE the catlist div.
 * Can anyone please point out to me what is wrong in my code?
 *     ```
       private function get_post_title($single, $tag = null, $css_class = null){
       	$event = the_field('event', $single->ID);
       	$info = '<h3 class="expand-post-title"><a href="' . get_permalink($single->ID) . '" title="'. $single->post_title .  '" name="'. $single->post_title . '">' . $single->post_title . '</a></h3><span>' . $event . '</span>';
       	return $this->assign_style($info, $tag, $css_class);
       }
       ```
   
 * [http://wordpress.org/extend/plugins/list-category-posts/](http://wordpress.org/extend/plugins/list-category-posts/)

The topic ‘Problem displaying posts custom field value’ is closed to new replies.

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

 * 0 replies
 * 1 participant
 * Last reply from: [Sprutt](https://wordpress.org/support/users/sprutt/)
 * Last activity: [13 years, 7 months ago](https://wordpress.org/support/topic/problem-displaying-posts-custom-field-value/)
 * Status: not resolved