WordPress.org

Ready to get started?Download WordPress

Forums

Navigation troubles (links disappear) (1 post)

  1. Cythera
    Member
    Posted 7 years ago #

    Right now, my menu looks something like this:
    Link 1
    Link 2
    Link 3
    Link 4
    Link 5
    Link 6

    Two of the pages has child pages, and I have been trying to find a way to include them in the menu like so: When you click the parent page, the child pages becomes visible in the menu, I found a link of coding which displays the child pages underneath the menu isself (although, below the parent page was what I originally wanted).

    My coding:
    <?php $pg_li="page_item"; if (is_home()) {$pg_li .=" current_page_item";}?>
    <ul><li class="<?php echo $pg_li; ?>"><a href="<?php bloginfo('siteurl'); ?>" title="Hem">Hem</a></li>
    <?php wp_list_pages('exclude=5,6,7,12,15&sort_column=menu_order&title_li='); ?>

    <?php
    if($wp_query->is_page && !is_home()) {
    $lp_param = "";
    $lp_param = "title_li=<strong>" . __('Undersidor') . "</strong>&depth=1&child_of=" .
    $wp_query->get_queried_object_id();
    wp_list_pages($lp_param);
    }
    ?></ul>

    When you click a link to one of the pages that has child pages, the child pages are displayed like I want them to. But when you click a link to one of the child pages the links to the child pages disappear.

    Just from looking at my coding, any ideas on what I could do?

    My site: http://lavished.nu (It's in swedish, but clicking on LAV or Annat will show you what I mean).

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags