• Resolved damassipappas

    (@damassipappas)


    Sorry for the semi-duplicate post; both questions rotate towards a single answer, but the methods for achieving said answer might need a little light…

    I’m trying to figure out how to limit the pages being returned by wp_list_pages to that of a single, specific, author:

    Here’s my code:

    wp_list_pages(‘post_author=$urlID’);

    But it returns ALL the pages by all the authors. Am I not understanding this function correctly? Does such functionality exist within the function?

    I’ve figured out how to return the number of pages written by a single author by using

    $pagesTotal = get_pages( “authors=$urlID”);
    echo count($pagesTotal;

    so I’m assuming other information is contained within the array, but I’m not quite sure how to access it, how to return the titles or links, etc, like wp_list_pages does.

    Any insights?

    Thanks again —

Viewing 3 replies - 1 through 3 (of 3 total)
  • You want wp_list_pages('authors=' . $urlID);

    Thread Starter damassipappas

    (@damassipappas)

    Fantastic. I knew it would be something very simple…

    Thanks again —

    filosofo… enlightening…. is there a list somewhere that shows what else can be used like this? For example, I want to GET a custom field (key=BDP-clients) from all the child pages (published) of a certain page…

    This would be get_pages() rather than wp_list_pages(), right?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘wp_list_pages >> Limit return pages to specific author?’ is closed to new replies.