I thought this would be simple, but cant figure it out or find any reference online. Basically Im trying to get posts who have the same meta value for a specific key as the current post. Heres what I have so far
global $authordata, $post;
$authors_posts = get_posts( array(
'author' => $authordata->ID,
'post_parent' => 0,
'orderby' => 'menu_order',
'post_type' => 'page',
'posts_per_page' => -1,
'meta_query' => array(
array(
'key' => 'stashkey',
'value' => $id,
'compare' => '=' )
)
) );
This works fine to get all posts who have a meta value which equals the same as the current post id - but I want to get it based on having the same meta value as the current post.
Thanks