query_posts for custom post type using post id (or name)
-
Hi,
I need to create an option for my users to save posts as favorites, I searched for plugins but none of theme are able to do this because I am using a custom post (‘ad_listing’). This creates issues approching the database because approaching the query from the wp_posts point of view table will have issues with the post_type as I am using custom post type “ad_listing” and approaching the query from wp_term_taxonomy point of view will create issues because the taxonomy is custom (“ad_cat”) insted of the default category and I didn’t saw a linking way.So this being said let me give some exaples of the code that will show exacly what I am tring to do but didn’t reach the correct output:
query_posts('post_type=ad_listing&p=160');
-this query will display all the posts in “ad_listing” so using “p=160” has no effect;query_posts(array('name'=>'b8d7p','post_type' => 'ad_listing'));
-this query will display all the posts in “ad_listing” so using “‘name’=>’b8d7p'” has no effect;query_posts(array('post_type'=>'ad_listing','post__in' => array(160,159)));
-this query will display all the posts in “ad_listing”So this is my challenge I hope somebody will be up to the task at least for pointing me to the right direction.Thanks and
Regards
- The topic ‘query_posts for custom post type using post id (or name)’ is closed to new replies.