WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Fold page list - where to start (3 posts)

  1. nenjahinurgras
    Member
    Posted 7 years ago #

    I have installed the Fold Page List plugin to highlight the current page's first Parent. Unfortunately I have no clue where to start with this plugin. I have opened the php file, and see some functions, which I try to use as in:

    _wswwpx_page_get_ancestor_ids(1);
    _wswwpx_page_get_ancestor_ids();
    wswwpx_fold_page_list();
    wswwpx_fold_page_list('exclude=8,9,26,27&sort_column=menu_order&title_li=<h3>'.__('Organization').'</h3>' );

    I tried this code, even all lines at the same time, but they just do not give me anything. I probably do not get it, maybe it's just too late.. The plugin page nor the forum give me any directions on how to use the functions. I have put the code into a theme, before the Loop.

    I just want to know the highest Parent of the current page, nothing more, nothing less. Can anyone give me a hint on where to look?

  2. nenjahinurgras
    Member
    Posted 7 years ago #

    ok, in a last resort I decided to Google for "_wswwpx_page_get_ancestor_ids" and found my solution in the WordPress Support forum which I could not find with the search box here. The following code is what you need to find the id of the upmost Parent for a page:

    // get id of current page
    $g_page_id = $wp_query->get_queried_object_id();
    // find ancestor pages
    $ancestors = _wswwpx_page_get_ancestor_ids($g_page_id);
    // find topmost ancestor
    $ancestor = reset($ancestors);
    print "$ancestor";
  3. syncbox
    Member
    Posted 6 years ago #

    OK, I just want all of the list items in a submenu to display...

    I am using the fold list plugin

    I am sorting by menu order and not using the pages title:

    <?php wswwpx_fold_page_list('title_li=&sort_column=menu_order','true'); ?>

    Here's what happens: The submenu (child pages) of a page are only displayed when that item is clicked. GREAT, that's what I want.

    None of the submenus pages (child pages) themselves have children.

    When I click on one of the submenu pages, the other "siblings" disappear.

    Is this SUPPOSED to happen? If not, how do I stop it? I'd like them to remain visible.

Topic Closed

This topic has been closed to new replies.

About this Topic