Title: Nested Inserted Pages
Last modified: August 24, 2016

---

# Nested Inserted Pages

 *  Resolved [lexopa](https://wordpress.org/support/users/lexopa/)
 * (@lexopa)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/nested-inserted-pages/)
 * Hi,
 * I love this plugin — and I love that its written in one single concise PHP file
   that I could hack on in case I need custom functionality. It’s brilliant!
 * One issue I’m having and maybe you can point me in the right direction (code 
   is fine, I’m a dev). I have 1 page with 3 inserted posts, that rendered correctly
   by itself. Then I insert that page into my homepage, and it doesn’t render the
   3 posts, it DOES render the page inserted itself, without the 3 posts.
 * Any ideas? I think this question’s been asked before on the forum but I’m not
   clear on the solution so far :/
 * Thanks again.
 * [https://wordpress.org/plugins/insert-pages/](https://wordpress.org/plugins/insert-pages/)

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

 *  Plugin Author [Paul Ryan](https://wordpress.org/support/users/figureone/)
 * (@figureone)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/nested-inserted-pages/#post-5999692)
 * Thanks for the kind words!
 * In a recent update I added a deep nesting check to prevent circular loops. Advanced
   users can override this behavior by hooking into the insert_pages_apply_nesting_check
   filter. See the v2.4 notes in the changelog:
    [https://wordpress.org/plugins/insert-pages/changelog/](https://wordpress.org/plugins/insert-pages/changelog/)
 * And here’s where it’s at in the code base:
    [https://bitbucket.org/figureone/insert-pages/src/b9d4396b955e8ec4b75dc018728e1f9782aeaca2/insert-pages.php?at=master#cl-117](https://bitbucket.org/figureone/insert-pages/src/b9d4396b955e8ec4b75dc018728e1f9782aeaca2/insert-pages.php?at=master#cl-117)
 * Hope that helps! Reopen this if you have more questions.
 *  [Haim](https://wordpress.org/support/users/koostamas/)
 * (@koostamas)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/nested-inserted-pages/#post-6000028)
 * Hi!
    I would like to add deep nesting. I see here a solution.
 * Is there a way to do it with an option in the short-code?
 * Or, if the above is the only solution… where should I insert this code and how
   can I make sure that it will work after new versions of the plugin, the template
   or WP itself?
 * Thanks a lot… for this great plugin!
 * Tamas
 *  Plugin Author [Paul Ryan](https://wordpress.org/support/users/figureone/)
 * (@figureone)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/nested-inserted-pages/#post-6000029)
 * You can place the following in your theme’s functions.php file to disable the
   deep nesting check:
 *     ```
       function your_theme_init() {
           // Disable nesting check to allow inserted pages within inserted pages.
           add_filter( 'insert_pages_apply_nesting_check', function ( $should_apply ) { return false; } );
       }
       add_action( 'init', 'your_theme_init' );
       ```
   
 * This hook will always work in future versions of Insert Pages; the only thing
   you need to worry about is if you overwrite the functions.php file in your theme,
   then you’d just need to add the code again.
 * In the future I might make this an option in the shortcode itself.
 *  [Haim](https://wordpress.org/support/users/koostamas/)
 * (@koostamas)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/nested-inserted-pages/#post-6000030)
 * Thank you, **Paul**!
 * I have added it, as you described it… and YES, it **WORKS**!
 * Great!
 * Tamas
    p.s. I am going to post another issue…

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

The topic ‘Nested Inserted Pages’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/insert-pages.svg)
 * [Insert Pages](https://wordpress.org/plugins/insert-pages/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/insert-pages/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/insert-pages/)
 * [Active Topics](https://wordpress.org/support/plugin/insert-pages/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/insert-pages/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/insert-pages/reviews/)

## Tags

 * [nested](https://wordpress.org/support/topic-tag/nested/)
 * [render](https://wordpress.org/support/topic-tag/render/)

 * 4 replies
 * 3 participants
 * Last reply from: [Haim](https://wordpress.org/support/users/koostamas/)
 * Last activity: [10 years, 10 months ago](https://wordpress.org/support/topic/nested-inserted-pages/#post-6000030)
 * Status: resolved