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

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