• Resolved meckhert

    (@meckhert)


    I am having a problem with the wp_list_pages template function. What I am trying to do is output the pages I have created under Admin -> Write -> Pages, as list items as part of a larger list. I want the items to appear without the
    <ul> tag. Briefly here is a mock-up of the code I’m using:

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

    I expect the wp_list_pages to output a
    <li> item for each static page that I have created. Instead, it is not generating any output at all. If I change the tag to wp_list_pages('title_li= '), I get output, but each of the top page categories is enclosed in
    <ul> tags.

    In summary, shouldn’t I see some content for wp_list_pages('title_li='), or is it really supposed to output nothing?</ul>
    </li>

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter meckhert

    (@meckhert)

    Reposted with backticks on the code…

    I am having a problem with the wp_list_pages template function. What I am trying to do is output the pages I have created under Admin -> Write -> Pages, as list items as part of a larger list. I want the items to appear without the <ul> tag. Briefly here is a mock-up of the code I’m using:

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

    I expect the wp_list_pages to output a
    # item for each static page that I have created. Instead, it is not generating any output at all. If I change the tag to wp_list_pages(‘title_li= ‘), I get output, but each of the top page categories is enclosed in <ul> tags.

    In summary, shouldn’t I see some content for wp_list_pages(‘title_li=’), or is it really supposed to output nothing?

    niziol

    (@niziol)

    I’m a little confused about what exactly you want to do, but perhaps read the wp_list_pages article on the Codex, you can do a variety of things with it, you just need to pass the proper argument for it.

    If you tell it to output without the title li, it should just print a list of your pages without a heading. Maybe explain what you mean a little clearer ??

    Good luck,
    Michael.

    Thread Starter meckhert

    (@meckhert)

    That’s just it… when I do: <?php wp_list_pages('title_li='); ?> nothing is output at all.

    If I do ‘title_li= ‘, the list does output, but it also adds the heading. The way I read the Codex, it seems like wp_list_pages('title_li=') should output something like this:

    <li>Page1</li>
    <li>Page2</li>

    Instead, I get no output at all.

    niziol

    (@niziol)

    Yes, it should be putting out the list without the title, you’ve said that you have pages, so there is stuff to print out…what version of WP are you running? Are there any plug-ins that could interfere? <?php wp_list_pages('title_li='); ?> SHOULD do exactly what you want, I just tried it on mine and it echo’d it without the title li, just as it should.

    Anyway, post a list of plug-ins that could possibly interfere and what version of WP you’re using and PHP too.

    Cheers,
    Michael.

    Thread Starter meckhert

    (@meckhert)

    I am using the following versions:

    WordPress: 2.01
    PHP: 5.1.2

    A quick check of Apache’s error logs has a couple of errors, which seem unrelated:

    [Wed Mar 01 12:50:11 2006] [error] [client 127.0.0.1] PHP Warning: Invalid argument supplied for foreach() in \\Wordpress\\wp-includes\\functions.php on line 2117
    [Wed Mar 01 12:50:11 2006] [error] [client 127.0.0.1] PHP Warning: Invalid argument supplied for foreach() in \\Wordpress\\wp-includes\\functions.php on line 2117

    I have tried a few different themes, and I have the same problem with all of them: no output for wp_list_pages(‘title_li=’)

    Marc

    moshu

    (@moshu)

    I’d upload a new (fresh) version/copy of the functions.php file.

    niziol

    (@niziol)

    I might be crazy, but I thought I’d read of some bizzare issues with PHP 5 and WordPress! Give what moshu suggested a try, maybe someone can shed some light on whether I’m crazy or there is something about PHP 5.

    Cheers,
    Michael.

    Thread Starter meckhert

    (@meckhert)

    I’ll give it a shot and let you guys know. I’ll also try disabling all the plugins I have (really I only have 1 extra, XD Forum) and see if that does anything.

    Appreciate the help.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘wp_list_pages problem’ is closed to new replies.