StudioPress Community Forums
  StudioPress Community Forums > Forums > General Discussion
For help and support, access to your downloads, or to manage your account please log into My StudioPress.

These forums have been set to read-only so you can browse the existing topics for any questions you may have -- and this forum will be removed on July 1st, 2013.

For general discussion on WordPress, CSS and design (NOT for support) visit the new Community Forums.
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 10-22-2012, 01:36 PM
motty07 motty07 is offline
Registered User
Genesis Member
Pro Plus Member
 
Join Date: Feb 2012
Posts: 54
Default Display info from a specific custom post

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.?
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
custom post info for a specific category pxforti General Discussion 4 05-29-2012 06:19 PM


All times are GMT -5. The time now is 12:52 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.