[wp-testers] Custom Types Listing

Sandro Gomes sandro.gomes at gmail.com
Mon Apr 12 03:45:29 UTC 2010


Working on an adaptation of the podcast 30 plugin from
http://kovshenin.com/archives/custom-post-types-in-wordpress-3-0/
<http://kovshenin.com/archives/custom-post-types-in-wordpress-3-0/>I faced
an issue...

I just can´t select only my custom post type to show on the loop, i can list
then with other posts and pages, but if do a query to filter the post  types
and only let my custom type to show, nothing happens, wp just ignores my
request.

I already tryed these codes, using them before the loop start:

-------------------------------
$wp_query = null;
$wp_query = new WP_Query();
$wp_query->query('post_type=planetario');
$posts = null;
$posts = $wp_query->posts;
-------------------------------

---------------------------------
query_posts ('post_type=planetario');
----------------------------------

Tryed to make is_ function to use right after the while but it was a
disaster, wp says the my function wasn't declared:

---------------------------------
// Checks if the post_type is planetario
function is_planetario()
 {
$post_type = get_post_type() ;
// short had for if / else;
 return $post_type == 'planetario' ? true : false;
}
-----------------------------------


Hope I am wrong and it is not a bug.

Thanks
-- 
Sandro


More information about the wp-testers mailing list