WordPress.org

Forums

WP Custom Fields Search
Return Post AND Custom Post Type Results? (2 posts)

  1. justbishop
    Member
    Posted 3 years ago #

    I have the following in my search.php, but searching is still only returning posts of the "post" type. I need to ALSO return posts of the "auctions" post type (I do not want results that contain the tags "blog" or "gallery", or have no value in the custom field "thumbnail". All of these conditions seem to be working fine):

    <?php
    $term = get_term_by('slug','blog', 'post_tag');
    $term2 = get_term_by('slug','gallery', 'post_tag');
    
    $args=array(
            'tag__not_in' => array($term->term_id, $term2->term_id),
            'category' => '-1',
            'post_type' => array('post', 'auctions'),
            'post_status' => 'publish',
            'caller_get_posts'=> 1,
            'meta_key' => 'thumbnail'
    );
    
    global $wp_query;
    query_posts(
            array_merge(
                    $args,
                    $wp_query->query
            )
    );
    if (have_posts()) : ?>

    http://wordpress.org/extend/plugins/wp-custom-fields-search/

  2. justbishop
    Member
    Posted 3 years ago #

    Bump. Anyone?

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Custom Fields Search
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic