Support

Account

Home Forums Front-end Issues Query Post with ID in Post Object field

Unread

Query Post with ID in Post Object field

  • Hi, I’m try to query post only if in a post object field there is an ID.
    I’ve tried with this and similar query but not work.

    $query_args = array(
         'post_type'      => 'post_type',
         'posts_per_page' => 10,
         'orderby'	      => 'title',
         'order'	      => 'ASC',
         'paged'          => $paged
    );
                                                
    if(isset($nome) && $nome) { 
    $query_args['meta_query'][] = array('key' => 'nome', 'value' => $nome, 'compare' => 'LIKE'); }
                                                
    if(isset($ref) && $ref) {
    $query_args['meta_query'][] = array('key' => 'collegamento', 'value' => '"' . $ref . '"', 'compare' => 'LIKE'); }

    I think is possible but I can not find the right code.

    Thanks for help!

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.