Forum Replies Created

Viewing 1 replies (of 1 total)
  • Hi guys!

    I created a custom post with register_post_type, which contains capability_type parameter with ‘page’ value and custom-fields property in supports array.

    I created a new post (my custom post type) and added a custom field for this post with these values:
    Custom field name: SAMPLE_KEY
    Custom field value: MY_VALUE

    I want to get this page by custom field value and name.
    I have tried this:

    $feature_query=new WP_Query();
    $features=$feature_query->query(‘meta_key=SAMPLE_KEY&meta_value=MY_VALUE’);

    The $features array was empty.
    What’s wrong in my code?

    Many thanks!

Viewing 1 replies (of 1 total)