Title: [Plugin: Dynamic Supages] Menu not appearing
Last modified: August 20, 2016

---

# [Plugin: Dynamic Supages] Menu not appearing

 *  [baysaa](https://wordpress.org/support/users/baysaa/)
 * (@baysaa)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-dynamic-supages-menu-not-appearing/)
 * Hello,
 * First of all, great module (Dynamic Subpages) saved me a lot of headache! Thank
   you.
 * I have a small issue:
    I have a page called “Information”, which has a child 
   page called “Blog”. Through the _wp-admin_ **Settings > Reading** page I set 
   my “Posts page” to “Blog” which is a child of Information page. I have also set
   up a new menu from _wp-admin_ **Appearance > Menus** and only added my top level
   pages there.
 * Now when I go to the “Blog” page it doesn’t show the submenu. All the other pages
   work perfectly. I dropped my custom widget area created for this plugin in the**
   header.php** template page so the widget area is there (I inspected the HTML 
   too, the widget area is there but it’s empty).
 * It seems like something’s not being set on the “posts” archive page when it’s
   set to a custom page through the wp-admin settings. Is this a known bug and is
   there a fix for this somewhere on the net?
 * I am going to try and solve this myself and will post if I come up with a solution.
   But in the meantime if anyone has a solution it would be greatly appreciated.
 * Thanks.
    Baysaa.
 * [http://wordpress.org/extend/plugins/dynamic-subpages/](http://wordpress.org/extend/plugins/dynamic-subpages/)

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

 *  Thread Starter [baysaa](https://wordpress.org/support/users/baysaa/)
 * (@baysaa)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-dynamic-supages-menu-not-appearing/#post-2424999)
 * Well I guess I should’ve looked at the code first before posting here.
 * After I posted my original post, I went to look at the code and I found the bug
   quite quickly. The problem was that when you’re on a posts archive page **global
   $post;** was not returning that page’s id, but instead returning the id of the
   first post on that page. The solution was very simple, just get the id of the
   page manually. Thanks to [http://www.blog.highub.com/cms/wordpress/wordpress-front-page-posts-page-id/](http://www.blog.highub.com/cms/wordpress/wordpress-front-page-posts-page-id/)
   I was able to manually get the page id of posts archive.
 * So here’s the fix: (Note: not tested on custom post types archive pages)
 * File:
    wp-content/plugins/dynamic-subpages/dynamic-subpages.php
 * Find:
    Should be line 57 on version 1.7.2 of the plugin `global $post;`
 * Replace with:
 *     ```
       // if blog 'posts' page get $post manually
       	// otherwise use global $post var
       	if(is_home()){
       		$post = get_post(get_option('page_for_posts'));
       	}else{
       		global $post;
       	}
       ```
   
 * Baysaa.
 *  [ladygeekgeek](https://wordpress.org/support/users/ladygeekgeek/)
 * (@ladygeekgeek)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-dynamic-supages-menu-not-appearing/#post-2425523)
 * Hi baysaa,
    Thanks a million for this.
 * I’ve managed to get the sub menu showing on the post archive page, but it doesn’t
   show up on the individual posts. Any ideas how I can do this?
    Many thanks,
 * Charlie
 *  Thread Starter [baysaa](https://wordpress.org/support/users/baysaa/)
 * (@baysaa)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-dynamic-supages-menu-not-appearing/#post-2425524)
 * It’s quite simple, if you’re using the default “post” type then simply replace
   the following line:
 * `if(is_home()){`
 * with:
 * `if(is_home() || 'post' == get_post_type()){`
 * For more conditions check [this page. ](http://codex.wordpress.org/Conditional_Tags)
 *  [ladygeekgeek](https://wordpress.org/support/users/ladygeekgeek/)
 * (@ladygeekgeek)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/plugin-dynamic-supages-menu-not-appearing/#post-2425526)
 * Thanks for getting back to me Baysas. I’ve changed it to this
 *     ```
       if(is_home() || 'post' == get_post_type()){
       		$post = get_post(get_option('page_for_posts'));
       	}else{
       		global $post;
       	}
   
             $this_page_id=$post->ID;
       ```
   
 * But it sub-menu still isn’t showing up on individual posts . Not sure what I’ve
   down wrong….thanks for your help!

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

The topic ‘[Plugin: Dynamic Supages] Menu not appearing’ is closed to new replies.

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

 * 4 replies
 * 2 participants
 * Last reply from: [ladygeekgeek](https://wordpress.org/support/users/ladygeekgeek/)
 * Last activity: [14 years, 1 month ago](https://wordpress.org/support/topic/plugin-dynamic-supages-menu-not-appearing/#post-2425526)
 * Status: not resolved