treehouse : what would you like to learn today?
Web Design Web Development iOS Development

[Solved] Unordered Lists question!

  • I am trying to create a footer in Wordpress that lists the pages and subpages to format JUST like it's typed below... with the main page followed by subpages on the same line, then the new main page is on the next line with it's subpages, etc.

      <ul>
          <li>Home</li>
          <li>About Us
              <ul>
                  <li>Our People</li>
                  <li>Our Philosophy</li>
              </ul>
          </li>
          <li>Services
              <ul>
                  <li>Creative</li>
                  <li>Instinctive</li>
              </ul>
          </li>
          <li>Contact Us
              <ul>
                  <li>Sign Up for Newsletter</li>
                  <li>Employment Opportunities</li>
              </ul>
          </li>
      </ul>
    

    The actual html is:

      <ul>
          <?php wp_list_pages( 'title_li=' ); ?>
      </ul>
    

    This shouldn't be so hard -- What am I missing? Here is the url: http://dev.trinityriverdesign.com/optivestinc/

    Thanks in advance!

  • it's better to do just the home about our process ... and prevent the submenus because it's a bad practice

  • As all the subpages are contained in ul.children, couldn't you just set them as inline eg:

    .footer ul .children {
      display: inline
    }
    

    If I'm misunderstanding your issue, get back to me and I'll be glad to help.

  • wp_list_pages is a fairly outdated. I would also recommend against displaying the sub-pages for the same reason Musama mentioned.

    Register a new nav menu instead. That way you can manage the links and all that fun stuff via the WP Dashboard.

    WP Nav Menu Codex

    WP Register Nav Codex

    Overview and Tutorial

  • Thanks to everyone... this is the first Wordpress site I've done, besides simple blogs...

    For this instance, we want the subpages included in the footer.

    I'll probably just have to manually create something when all the pages have been determined.

  • Whoa whoa whoa. Why are we suggesting that a submenu is bad practice?

  • Using nav is allot easier and more convenient than using lists as navigation.

  • I would also like to know why submenus are bad practice.

    @janet4now Maybe http://codex.wordpress.org/Function_Reference/get_pages might help you. Rather than spitting out a preformatted list, it will give you an array to do with as you please.

  • To clarify, I was against the idea of having the sub menu items all inline. Especially if if another parent item is displayed on that line.

    I believe looking at janet's post now, the board was just barfing up the list in her code rather than formatting it as a code block.

  • the board was just barfing up the list in her code rather than formatting it as a code block.

    You mean it's just chucking out a list of 'li' without any indication as to whether they are submenu list items or not?

    It doesn't seem to be doing that now...

  • That's because I fixed it ;)