Custom Post Type Query Issue
-
Hey All,
Absolutely loving WordPress 3.0 feature which finally brings it up to par with EE’s Channels to make it an out of the box full fledged CMS. Then again, I’m coming from Joomla, so the entire system is so refreshing.
I’ve read about 7 articles on custom post types. I’ve successfully created the function to add it in the functions.php file and shows up properly in the admin. Added an custom post as well.
Here is the code that pulls in a category to feed the slideshow:
if (get_option('wdg_use_pages') == 'false') query_posts("showposts=$featured_num&cat=".get_catId($featured_cat)); else { global $pages_number; if (get_option('wdg_feat_pages') <> '') $featured_num = $pages_number - count(get_option('wdg_feat_pages')); else $featured_num = $pages_number; query_posts(array ('post_type' => 'page', 'orderby' => 'menu_order', 'order' => 'ASC', 'post__not_in' => get_option('wdg_feat_pages'), 'showposts' => $featured_num )); }; while (have_posts()) : the_post(); ?> <div class="slide"> "> <?php $post_title = get_the_title(); $thumbnail = get_thumbnail($width,$height,'thumb',$post_title,$post_title); $thumb = $thumbnail["thumb"]; print_thumbnail($thumb, $thumbnail["use_timthumb"], $post_title, $width, $height, 'thumb'); ?> <div class="description"> <h2>"><?php truncate_title(27); ?></h2> <?php $tagline = get_post_meta($post->ID, 'Tagline', true); if ($tagline != '' ) { ?> <p class="tagline">“<?php echo($tagline) ?>”</p> <?php } ?> <p><?php truncate_post(375);?></p> " class="readmore"><span><?php _e('Read More', 'WDG');?></span> </div> <!-- end .description --> </div> <!-- end .slide -->
This works great. But now I need it to pull in from my new custom post type called featured.
So I need to incorporate this into the aboves first line:
global $wp_query; $wp_query = new WP_Query("post_type=property&post_status=publish&posts_per_page=5");
So far no luck. Anyone know the proper syntax to do this? I could provide more information, but giving this for now in case it’s a quick solution. Thank you!
Cheers,
Christopher
- The topic ‘Custom Post Type Query Issue’ is closed to new replies.