how to get all the value of special meta_key (2 posts)

  1. maojiemng
    Posted 7 years ago #

    the same as the title.
    I wirte a function named get_meta_value.But I Can't get the key_value of the special meta_key.In fact there should be 2 value.

    pluging file:

    function get_meta_value( $meta_key) {
    	global $wpdb;
    	$meta_value=$wpdb->query('Select meta_value FROM $wpdb->postmeta WHERE meta_key = '.$meta_key);
    	return $meta_value;

    index.php file

    for($i=0;$i<count($thumbnail);$i++) {
    <img src="<?php echo $thumbnail[1];?>"/>
    <?php }?>

    is there any problem?anybudy can help me?

  2. MichaelH
    Posted 7 years ago #

    Using_Custom_Fields has information and get_post_custom_values should work for you.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.