Support

Account

Home Forums General Issues get the custom post type data using a custom field value in type is post_object

Unread

get the custom post type data using a custom field value in type is post_object

  • I want to get data using the custom field type is post_object. But the couldn’t get I think my meta_query type is wrong.

    $title = get_the_title();
    $the_query = new WP_Query( array(
    ‘posts_per_page’=>9,
    ‘post_type’=>’brand-name’,
    ‘order’ => ‘ASC’,
    ‘meta_query’ => array(
    array(
    ‘key’ => ‘generic-name’,// this key is advance custom field: type post_object
    ‘value’ => $title,
    ‘type’ => ‘char’ // type not working
    ),
    ),
    ‘paged’ => get_query_var(‘paged’) ? get_query_var(‘paged’) : 1)
    );`

Viewing 1 post (of 1 total)

The topic ‘get the custom post type data using a custom field value in type is post_object’ is closed to new replies.