WordPress.org

Support

Support » Plugins and Hacks » how to get all the value of special meta_key

how to get all the value of special meta_key

  • 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

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

    is there any problem?anybudy can help me?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘how to get all the value of special meta_key’ is closed to new replies.