Title: Show custom fields with query_posts
Last modified: August 22, 2016

---

# Show custom fields with query_posts

 *  Resolved [raygo](https://wordpress.org/support/users/raygo/)
 * (@raygo)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/show-custom-fields-with-query_posts/)
 * Hi created a custom post called “slides” and created 2 custom fields “slide” 
   and “phrase”.
 * When I do :
 *     ```
       $args=array(
                   'post_type' => 'slides',
                   'posts_per_page' => 5
           );
   
       $my_query = query_posts($args);
   
       print_r($my_query);
       ```
   
 * I get the posts but I don’t get any of the custom fields. Is there something 
   I’m doing wrong? Thanks
 * [https://wordpress.org/plugins/types/](https://wordpress.org/plugins/types/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Marcin Pietrzak](https://wordpress.org/support/users/iworks/)
 * (@iworks)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/show-custom-fields-with-query_posts/#post-5380489)
 * Hi raygo
 * To obtain custom fields (post meta) you must use this function: [http://codex.wordpress.org/Function_Reference/get_post_meta](http://codex.wordpress.org/Function_Reference/get_post_meta)
 * Marcin
 *  Thread Starter [raygo](https://wordpress.org/support/users/raygo/)
 * (@raygo)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/show-custom-fields-with-query_posts/#post-5380491)
 * Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Show custom fields with query_posts’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/types_ced1d3.svg)
 * [Toolset Types - Custom Post Types, Custom Fields and Taxonomies](https://wordpress.org/plugins/types/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/types/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/types/)
 * [Active Topics](https://wordpress.org/support/plugin/types/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/types/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/types/reviews/)

## Tags

 * [custom fields](https://wordpress.org/support/topic-tag/custom-fields/)
 * [custom post](https://wordpress.org/support/topic-tag/custom-post/)

 * 2 replies
 * 2 participants
 * Last reply from: [raygo](https://wordpress.org/support/users/raygo/)
 * Last activity: [11 years, 7 months ago](https://wordpress.org/support/topic/show-custom-fields-with-query_posts/#post-5380491)
 * Status: resolved