I'm really at loss as to why this isn't working:
I am using a shortcode to display a query on a custom post type + taxonomy, this is the segment of it:
// - arguments -
$args = array(
'post_type' => 'customposttypename',
'taxonomyname' => 'alpha',
'post_status' => 'publish',
);
// - query -
$my_query = null;
$my_query = new WP_query($args);
while ($my_query->have_posts()) : $my_query->the_post();
// - variables -
$custom = get_post_custom($post->ID);
... and then variables keep going. The thing is though, when I run the loop, it shows me all of the default post content (i.e. title, content, etc.), but refuses to show custom post type content and halts on the last line above (line 145), i.e. $custom = get_post_custom($post->ID);
giving me the following error..
Notice: Undefined variable: post in C:\xampplite...\functions.php on line 145
Notice: Trying to get property of non-object in C:\xampplite...\functions.php on line 145
Then down here it shows me the title, content, etc. normally (just no custom post type content)
Anybody have a clue what' I'm doing wrong?
Thank you!