I have added a field in wordpress posts table named “parent_location”. How to get the value of this field in db front end? I have tried get_post_custom_values('parent_location', $post_id) function but it not working. Can any body help me out?
Thanks in advance, don’t down vote
You added the field as a new column in wp_posts or added a new metadata entry to a single post? If its to a post then just do a
get_post_meta(postID, 'parent_location', true);It its a new column into wp_posts, then should you not be able to just to a standard;Not sure if that will work, I’ve not tried to get a custom column via that method before. If it doesn’t, just roll your own SQL query; http://codex.wordpress.org/Class_Reference/wpdb