• Resolved stigroar

    (@stigroar)


    I am developing a website for a brassband, and want to organize the memberslist as follows:

    lvl 1: Memberslist – information page about the entire band.
    lvl 2: Groups – Instrumental groups withing the band (cornets, trombones, percussion…)
    lvl 3: Members – Individual page for each member

    All the members will be children of a group, and all groups will be children of the top parent Memberslist.

    This is the way my memberslist is organized, now to the point… I want it to be shown as on https://www.kbb.no (the site is in norwegian, but you may get the clue of what i’m thinking). Important translations: Memberslist=Medlemmer (lvl 1); Kornetter, Trombone, Slagverk etc. = Cornets, Trombones, Percussion etc (lvl 2); Members are shown on lvl 3 in menu.

    Choose a member, and you will also get a menu on the right hand side with all members within the group.

    How can I do this in WordPress? The structure is easy, but does anybody know any plugins for the submenu and the sidebar?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter stigroar

    (@stigroar)

    a drop down menu is btw the name of the menu i’m looking for. How can i change the subject in this thread?

    Thread Starter stigroar

    (@stigroar)

    found out that i can use this drop down menu:https://www.invokemedia.com/css-dropdown-menu-with-wordpress.html

    but i still havn’t found a usable sidebar…

    Thread Starter stigroar

    (@stigroar)

    Regarding the sidebar, I have found a theme which uses this code:

    /* Creates a menu for pages beneath the level of the current page */
    if (is_page() and ($notfound != ‘1’)) {
    $current_page = $post->ID;
    while($current_page) {
    $page_query = $wpdb->get_row(“SELECT ID, post_title, post_status, post_parent FROM $wpdb->posts WHERE ID = ‘$current_page'”);
    $current_page = $page_query->post_parent;
    }
    $parent_id = $page_query->ID;
    $parent_title = $page_query->post_title;

    if ($wpdb->get_results(“SELECT * FROM $wpdb->posts WHERE post_parent = ‘$parent_id’ AND post_status != ‘attachment'”)) { ?>

    <div class=”sb-pagemenu”><h2>
    <?php echo $parent_title; ?> Subpages</h2>

      <?php wp_list_pages(‘sort_column=menu_order&title_li=&child_of=’. $parent_id); ?>

    This generates a list of all instrument groups and all musicians in each group. I suppose it’s possible to configure this code, so that it only shows the actual group and the related musicians. I have tried, but my PHP skills stinks, so I could really need som help…

    Thread Starter stigroar

    (@stigroar)

    finally figured it out. the following code in sidebar.php does the trick ??

    <?php /* Creates a menu for pages beneath the level of the current page */
    if (is_page() and ($notfound != ‘1’)) {
    $current_page = $post->ID;

    $page_query = $wpdb->get_row(“SELECT ID, post_title, post_status, post_parent FROM $wpdb->posts WHERE ID = ‘$current_page'”);
    $current_page = $page_query->post_parent;
    $parent_id = $page_query->ID;
    $parent_title = $page_query->post_title;

    if ($current_page != 0) {
    $parent_query = $wpdb->get_row(“SELECT ID, post_title, post_status, post_parent FROM $wpdb->posts WHERE ID = ‘$current_page'”);

    $parent_id = $parent_query->ID;
    $parent_title = $parent_query->post_title;
    }

    if ($wpdb->get_results(“SELECT * FROM $wpdb->posts WHERE post_parent = ‘$parent_id’ AND post_status != ‘attachment'”)) { ?>

    <div class=”sb-pagemenu”><h2>
    <?php echo $parent_title; ?></h2>

      <?php wp_list_pages(‘sort_column=menu_order&title_li=&child_of=’. $parent_id); ?>
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Sidebar and menu for pagegroups’ is closed to new replies.