I am getting this error when I try to return the post_title value from my WP_Query:
**Fatal error:** Cannot use object of type WP_Query as array
Here is the code:
$query = new WP_Query( array( 'meta_key' => 'Old ID', 'meta_value' => $atts['oldid'] ) ); return $query['post_title'];
How can I show the elements of the post after this query? I am using WP_Query because I am making a shortcode to be used within Posts and Pages.