[resolved] Page List and Page Children (3 posts)

  1. marques_uk
    Posted 3 years ago #


    I was wondering if anyone knew a solution to the problem I'm having.

    I have found some code that does exactly as I want, please see below.

    [Code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]

    and then displaying <ul><?php js_list_pages_include_tree('include_tree=10'); ?></ul> in the page.

    This code can be found Here!

    How would I amend this funtion so that the main pages are links as well? If anyone could help me with this that would be great.

    I'm also looking to style this but I'm guessing I can style the main page list as norm and for the children if I add a class to the list in the function, I can style this from here?

    Thanks in advance

  2. esmi
    Forum Moderator
    Posted 3 years ago #

  3. marques_uk
    Posted 3 years ago #

    Thanks esmi, but found a solution to my problem, I found this code in another thread.

    $page_ids = array(1,2,3);
    foreach($page_ids as $page_id) {
      $page = wp_list_pages("echo=0&title_li=&include=$page_id");
      $submenu = wp_list_pages("echo=0&title_li=&child_of=$page_id&depth=1");
      if($submenu) $page = str_replace("</li>", "<ul>$submenu</ul></li>", $page);
      echo $page;

    Click Here!

    Does exactly what I wanted, thanks dougwaltman.

Topic Closed

This topic has been closed to new replies.

About this Topic