Awake Sub Navigation Widget- Displays page, NOT sub pages

(11 posts) (5 voices)

  1. mikru2010
    Member

    The widget description says "Displays a list of SubPages".

    But when put in sidebar, it only display my pages, and not the sub-pages or child pages.

    It would really be great if it would display the sub-pages too, perhaps slightly indented.

    Posted 1 year ago #
  2. Dorian
    Support

    Hi mikru2010,

    Could you give us a link to your website so we can see where this is happening, please?

    Posted 1 year ago #
  3. mikru2010
    Member

    You can reproduce this easily by just creating a subpage for any page already existing Next use the widget in the sidebar on standartemplate. As you will see the widget displays the page(s), but not the subpage(s).

    If it shows the subpage on your installation, please give me a link to the site ...

    Posted 1 year ago #
  4. mikru2010
    Member

    Ok, i have to correct myself.

    The widget displays the subpage or childpages to a parent page ONLY when you are on child page level (when you browse a subpage to a page, the other subpages to the parent page are shown)

    My problem is, that it doesn't show there are subpages to a given page when you are on any other parent page.

    So what i look for is a functionality to display subpages in the navigation, no matter if i'm browsing at parents page or child page level.

    Posted 1 year ago #
  5. Elliott
    Support

    Hey mikru2010,

    I was trying to help another user with this but I was having problems. I will move this to feature requests and we might see this in the next update.

    Sorry for the inconvenience.

    Posted 1 year ago #
  6. Any solution to this problem... It is still there.

    Posted 1 year ago #
  7. Elliott
    Support

    Hello terence123,

    For a simple solution you can open up /wp-content/themes/awake/lib/functions/widgets.php and on line 94 you should find this,

    $children = wp_list_pages("sort_column=menu_order&exclude=$page_exclusions&title_li=&child_of=".$parent."&echo=0&depth=1");

    Change it like this,

    $children = wp_list_pages("sort_column=menu_order&exclude=$page_exclusions&title_li=&child_of=".$parent."&echo=0&depth=4");

    And then add this line in your style.css file to indent them,

    .webtreats_subnav_widget .children { padding-left: 20px; }

    We'll have some more solutions worked out after we launch the new framework.

    Posted 1 year ago #
  8. Dear Elliott

    This is not working. Have a look at this page http://bit.ly/jsY62b
    In the left sidebar only child pages which are under the current page should be visible.
    I have following Structure
    Parent Page (XYZ)
    -Sub page (ABC)
    -SubSub Page (pqr)
    Now when I am on parent page, the side bar should have only Subpage (ABC), and when I select any of the subpage only respective subsub page (pqr) should be there. I Hope i have made it little clear and believe the awake subnavigation widget was also made keeping in mind this structure. Hope this will help resolve it faster

    Posted 1 year ago #
  9. Elliott
    Support

    It appears to be working fine terence123. Are you wanting it to display only the direct children of the current page?

    If that is the case then try this,

    $children = wp_list_pages("sort_column=menu_order&exclude=$page_exclusions&title_li=&child_of=".$post->ID."&echo=0&depth=2");

    Posted 1 year ago #
  10. Hi, I had the same issue with Modular - and resolved it by changing the code as specified above, thanks.

    Is there any chance this can be added as an option? - also, an option to have the widget not display at all if there are no pages to show would be great.

    - Josh

    Posted 1 month ago #
  11. FYI, I have got it to do what I need adjusting the code as below.
    This will only show the widget if there are sub-pages and it will show the same level if there are no lower levels (but will not show for top level without subs).

    $children = wp_list_pages("sort_column=menu_order&exclude=$page_exclusions&title_li=&child_of=".$post->ID."&echo=0&depth=4");
     
    if($children == '' && $parent > 0){
      $children = wp_list_pages("sort_column=menu_order&exclude=$page_exclusions&title_li=&child_of=" . $parent . "&echo=0&depth=2");
    }
     
    if($children != ''){
      $out .= '
    <ul>';
      $out .= $children;
      $out .= '</ul>
    ';
     
      $out .= $after_widget;
     
      echo $out;
    }
    Posted 1 month ago #

Reply

You must log in to post.

Construct WordPress Theme
Construct wordpress theme
Myriad WordPress Theme
Myriad wordpress theme
Method WordPress Theme
Method wordpress theme
Fusion WordPress Theme
Fusion wordpress theme
Elegance WordPress Theme
Elegance wordpress theme
Echelon WordPress Theme
Echelon wordpress theme
Dejavu WordPress Theme
Dejavu wordpress theme
Modular WordPress Theme
Modular wordpress theme