WordPress.org

Ready to get started?Download WordPress

Forums

V1.5 wp_list_pages problem (3 posts)

  1. monkeynotes
    Member
    Posted 9 years ago #

    I have a problem where I cannot get the page list function to work correctly. It works on my local setup but when I put it live it either fails silently on the parent page, and then on child pages it gives me this error:

    Warning: Invalid argument supplied for foreach() in /home/path_to_site/wp-includes/template-functions-post.php on line 368

    Array
    (
    [depth] => 0
    [show_date] =>
    [child_of] => 0
    [title_li] => Pages
    )

    Array
    (
    [8] => Array
    (
    [title] =>
    [name] => privacy
    )

    [7] => Array
    (
    [children] => Array
    (
    [0] => 8
    )

    )

    )

    I am stumped by this - like I said it works fine running locally.

  2. monkeynotes
    Member
    Posted 9 years ago #

    It appears that wp_list_pages does not like being requested after things like:

    <?php the_title(); ?>
    <?php the_content(); ?>

    Have been processed. If I take them out of the page it goes through just fine. This is really odd.

  3. dilemmalyn
    Member
    Posted 9 years ago #

    I have a similar problem. when I put child_of=# in the wp_list_pages, I get that error on line 368. Also, the sort_column option simply does not work for me. Other options have worded.

    For me, wp_list_pages is fine after ?php the_content(), it is just the child_of that causes a bug.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.