WordPress.org

Ready to get started?Download WordPress

Forums

Flexi Pages Widget
[resolved] No sub pages... (8 posts)

  1. matius
    Member
    Posted 3 years ago #

    All there is to say really...

    Unless there's a fix somewhere?

  2. matius
    Member
    Posted 3 years ago #

    May be obvious but you have to include the child page in menu for it to show up using the plug-in.

  3. magnetik
    Member
    Posted 3 years ago #

    I want to list all the child of a page ; i've selected the first ; but it doesn't list all the sub pages..

    I don't understand your solution ; I've to select all sub page manually ?

  4. matius
    Member
    Posted 3 years ago #

    Yep select sub pages manually.

  5. Matt Rittman
    Member
    Posted 3 years ago #

    Well that pretty much defeats the purpose of this plugin lol. Why would you have to manually select the sub pages!?

  6. Sidney Harrell
    Member
    Posted 3 years ago #

    We wanted to use this plugin for a project, but I didn't like the behavior. If you chose option 1, display all sub pages, it would show the entire site, which was too much. If you chose option 3, display strictly related sub pages, it would only show the top level sub pages. Option 2 was, I believe, broken in that it had the same behavior as option 3. I went ahead and modified it to display all the subpages under the page that you are currently on. I added these two lines after line 156 of version 1.6.3:

    global $wp_query;
       $current_page = &get_post($wp_query->get_queried_object_id());

    I added the following between lines 159 and 160 of the original:

    $curr_page = &$page;
       $hierarchy = array();
       $hierarchy[] = $curr_page->ID;
       while($curr_page->post_parent) {
          $curr_page = &get_post($curr_page->post_parent);
          $hierarchy[] = $curr_page->ID;
       }

    And I modified line 167 of the original by changing the following:
    Original:
    !in_array($page->ID, $currpage_hierarchy))
    Modified:

    !(in_array($current_page->ID, $hierarchy) ||
                in_array($page->ID, $currpage_hierarchy)))

    Sorry if it's not elegant, but I was in a rush.

  7. computerfixpro
    Member
    Posted 3 years ago #

    Sidney Harrell's code worked great for me, THANKS!!!

  8. SriniG
    Member
    Plugin Author

    Posted 3 years ago #

    I'm sorry, but the plugin works the way it's supposed to work (please read the plugin description and FAQ). I just tested the plugin with WP 3.2-beta2 with various different variations of pages and child pages with all the different options and it all works well. None of the options is broken.

    Different people want to display the list of their pages/subpages in different ways, and it's just impractical to provide various different options to meet all those demands. Moreover, majority of the people who use the plugin use it the way it works, and if I change any of that functionality, they will all protest. So there is no question of modifying the functionalities or adding more options unless a particular option is in great demand and if it's feasible.

    Of course, the plugin is open source and anybody can go into the code and change it to work the way they want, just as Sidney Harrell has done, I totally appreciate that. And I appreciate if such modified code is shared so that anybody who needs a similar fix can use the modified code.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic