Home Forums General Issues Query by meta value with 'page link' field


Query by meta value with 'page link' field

  • Hi

    I’ve got a post in ‘videos’ custom post type. It has a ‘page link’ custom field to select a related post (populated with posts from ‘gigs’ post type).

    I use the following query on the ‘gigs’ single page, to grab related videos, where the page link is the same as my current url. The page link and url values match, but the query doesn’t return any results.

    If I try the same thing with a true/false field in the ‘videos’ post, it works.

    $args = array( ‘posts_per_page’ => 5, ‘post_type’ => ‘videos’, ‘meta_key’ => ‘associated’, ‘meta_value’ => $page_url

    any help would be appreciated, thanks 🙂

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.