Hi
I'm trying to display details from a specific custom post (using a post id) in the sidebar.
The code I'm using (just a starter test) is:
PHP Code:
function sidebar_photo_advert_static()
{
$spas_loop = new WP_query('p=7022');
while ( $spas_loop->have_posts() ) : $spas_loop->the_post();
echo '<li>';
the_title();
echo '</li>';
endwhile;
}
It works fine if 7022 is a regular 'post', but not if is a custom post (say type = adverts). Any ideas on the query I need to use for a specific custom post type where the type is 'adverts' and the id 7022.?