Custom field page id's
-
I’m working on a plugin which i’m going to make available for free.
I’ve made a custom post type called ‘popup’, and I’ve created a custom field in which users can choose where the popup should appear. So they fill in page ID (comma seperated). I put those page’s in 1 array.
Now comes the challenging thing:
How do I query for a value in an array?
I thought of something like this:
$args = array( 'post_type' => 'notifications', 'posts_per_page' => 1, 'orderby' => 'menu_order', 'order' => 'ASC', 'meta_query' => array(array( 'key' => 'page_ids', 'value' => '103' )) );
The problem is; there is not just a ‘103’ in the page_ids key. There is an array which contains the page 103.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Custom field page id's’ is closed to new replies.