Title: TOC in custom WP_Query
Last modified: June 7, 2019

---

# TOC in custom WP_Query

 *  Resolved [Troglos](https://wordpress.org/support/users/troglos/)
 * (@troglos)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/toc-in-custom-wp_query/)
 * I have a custom WP_Query that shows 1 post in a category page and I would like
   to show the TOC for this post with a shortcode.
 *     ```
       $args = array(
          'post_type' => 'post', 
          'posts_per_page' => 1, 
          'p' => $ID_articolo,
       );								
       $the_query = new WP_Query( $args );
       ```
   
 * I’ve followed the help section without success.
    Any suggestion?
 * Thank you.

The topic ‘TOC in custom WP_Query’ is closed to new replies.

 * ![](https://ps.w.org/table-of-contents-plus/assets/icon-256x256.png?rev=1151771)
 * [Table of Contents Plus – Automatic Table of Contents for Posts & Pages](https://wordpress.org/plugins/table-of-contents-plus/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/table-of-contents-plus/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/table-of-contents-plus/)
 * [Active Topics](https://wordpress.org/support/plugin/table-of-contents-plus/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/table-of-contents-plus/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/table-of-contents-plus/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [Troglos](https://wordpress.org/support/users/troglos/)
 * Last activity: [7 years, 2 months ago](https://wordpress.org/support/topic/toc-in-custom-wp_query/)
 * Status: resolved