i have a single post's custom meta, ex:
custom meta key = moviename
custom meta value = HarryPotter
i can use code:
<?php echo get_post_meta($post->ID, 'moviename', true); ?>
to get the post's custom meta value "HarryPotter"
but, how can i get the custom meta key "moviename",
with the value "HarryPotter" that i know?
now, i use
<?php
$customkeys = $wpdb->get_results("SELECT meta_key FROM $wpdb->postmeta WHERE meta_value = 'HarryPotter'");
$meta_key = $customkeys[0]->meta_key;
?>
just can get Key just first of one, it's not current post Key.
because i have more post have value"harrypotter" in different Key.
how can i get current post that key name