WordPress.org

Support

Support » Requests and Feedback » How do I search post metadata?

How do I search post metadata?

Viewing 7 replies - 1 through 7 (of 7 total)
  • after a few hours messing with the suggestions made in the codex:
    $readinglist = $post_meta_cache[256][‘reading’];
    get_post_custom()
    get_post_custom_keys()
    get_post_custom_values($key)

    i couldn’t make it work , on post loops (and I have some of those)
    finally found somewhere on the funtion.php file something that works:

    echo get_post_meta($post->ID,’data’,TRUE);

    be happy 😉

    I’m in the same situation as logista but, unfortunately, I can’t follow spark’s suggestion.

    is it just the one line of code that I need:
    echo get_post_meta($post->ID,’data’,TRUE);

    and is it that I should add this to the functions.php file in the wp-includes directory? Does it matter where?

    I have the same problem. I really need to include the costum field values in searches. I’ve been searching for an hour now, but can’t find any solutions for WP 1.5.

    Anybody?

    Someone posted this on another thread:

    http://randomfrequency.net/wordpress/search-meta/

    seems to do the job!

    If you want the one line solution, this works for me, to return one value from a custom field, when used inside The Loop:

    <?php echo get_post_meta($post->ID, 'customfieldname', $single = true); ?>

    The search meta hack doesn’t work with the most updated version of WP (1.5.#) only with 1.5 and below. 3stripe – I don’t think that’s what people are asking for here. What we are looking for is a plugin that will also SEARCH the postmeta data in addition to the post title and post content not just echo the postmeta info for a certain post.

    Ah ok my bad. There must be an updated plugin for this out there somewhere?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘How do I search post metadata?’ is closed to new replies.
Skip to toolbar