WordPress.org

Forums

Types
Problem with WP_QUERY (3 posts)

  1. christoss1959
    Member
    Posted 3 years ago #

    I've been trying use WP_QUERY to show my posts only if typeofgame is equal to 5x5, however the code below doesn't show any posts. Typeofgame is a single line of text. If I remove the meta_query bit it shows all posts.

    <?
    $args = array(
    
    'post_type' => 'post',
    'posts_per_page' => 10,
      'meta_query'=> array(
        array(
          'key' => 'wpcf-typeofgame',
          'compare' => '=',
          'value' => '5x5'
        )
      )
    
    );
    ?>
    <?php $loop = new WP_Query( $args); ?>

    http://wordpress.org/extend/plugins/types/

  2. Naz
    Member
    Posted 3 years ago #

    I'm not 100% sure this will work, but have you tried using 'typeofgame' instead of 'wpcf-typeofgame'?

  3. christoss1959
    Member
    Posted 3 years ago #

    Yeah I've tried it and it doesn't work. I am really buffled by this..

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Types
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags