How do I display custom fields in the posts using types plug-in in wordpress

I am presently using types plug-in to display the event list, I am able to add the custom fields for admin to enter date and location, but I am unable to display the custom fields along with the posts in the site, please tell me the solution.

I tried with the following code, but no use,

$key="wpcf-date"; echo get_post_meta(4, $key, true);


$querystr = "SELECT $wpdb->posts.* FROM $wpdb->posts, $wpdb->postmeta";

$pageposts = $wpdb->get_results($querystr, OBJECT);

echo $pageposts;

Related posts

Leave a Reply

2 comments

  1. On the page where you are doing the code did you defined wpdb as below..

    global $wpdb;

    Try to echo the ID above the 2 lines given by RafH so that you will know whether ID is coming or not.

    echo get_the_ID();