0
votes

I want to get post meta for a particular key where metakey matched with any particular id.

for example:-

I want all value of rating where author_id =1 in post meta;

By using :- get_post_meta( $post_id, 'rating', $single );

1
Did you figure it out? - Jason Ellis

1 Answers

0
votes

Try this:

 <?php
 $author_id = $post->post_author;

 if($author_id == 1){
      get_post_meta( $post_id, 'rating', $single );
 }
 ?>