Home Forums ACF PRO @John Huebner


@John Huebner

  • Hi John,
    After days and days, I finally find your post LINKED
    I understand the main idea and I tried it.
    In the database, the new color_wp metakey contain many datas (see below) …
    How can I query on this, what’is my mistake?
    Thanks for your help.

    O:7:"WP_Post":24:{s:2:"ID";i:6016;s:11:"post_author";s:2:"22";s:9:"post_date";s:19:"2017-11-27 10:32:02";s:13:"post_date_gmt";s:19:"2017-11-27 09:32:02";s:12:"post_content";s:0:"";s:10:"post_title";s:12:"Espace Auzon";s:12:"post_excerpt";s:0:"";s:11:"post_status";s:7:"publish";s:14:"comment_status";s:6:"closed";s:11:"ping_status";s:6:"closed";s:13:"post_password";s:0:"";s:9:"post_name";s:12:"espace-auzon";s:7:"to_ping";s:0:"";s:6:"pinged";s:0:"";s:13:"post_modified";s:19:"2018-01-25 13:20:31";s:17:"post_modified_gmt";s:19:"2018-01-25 12:20:31";s:21:"post_content_filtered";s:0:"";s:11:"post_parent";i:0;s:4:"guid";s:56:"";s:10:"menu_order";i:0;s:9:"post_type";s:5:"lieux";s:14:"post_mime_type";s:0:"";s:13:"comment_count";s:1:"0";s:6:"filter";s:3:"raw";}

  • I’m not sure I understand the question. How to you query posts based on the color_wp value given in my example?

    $args = array(
      // other query args
      // whatever you need
      meta_query => array(
          'key' => 'color_wp',
          'value' => 'red'
    $my_query = new WP_Query($args);

    see WP_Query

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.