Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Asuka1911

    (@asuka1911)

    please, anyone who can help me? ._.”

    Plugin Author Ben Huson

    (@husobj)

    If not tested this, but the short code should accept the same parameters as the wp_list_pages() function.

    The wp_list_pages() documentation says generally it’s arguments are inherited from get_pages() function.

    If this is the case you may be able to pass a number parameter to specify the number of pages to show and the authors parameter to specify usernames.

    [list-pages number="5" authors="my_username"]

    Maybe try that and see if it works.

    Thread Starter Asuka1911

    (@asuka1911)

    thank you, I tried that but unfortunately it doesn′t work. If I use that It still lists all pages of that author.

    I couldn’t get it to work either. I found one forum that mentioned it was a bug in wordpress, but that was from 2011, so you’d think it would be fixed by now.

    What I finally did was get the plugin “Allow PHP in Posts and Pages”, and then I inserted this code in a page:

    [php]
    $howmany = 20;
    $pages = wp_list_pages(“echo=0&title_li=&sort_column=post_date&sort_order=DESC&depth=-1&exclude=8138&show_date=true”);
    $pages_arr = explode(“\n”, $pages);
    for($i=0;$i< $howmany;$i++){
    echo $pages_arr[$i];
    }
    [/php]

    It shows the most recent 20 pages, sorted by date, and showing the date. I also excluded the particular page that had this list…you’ll have to change the number to whatever your page ID is.

    I took this code from another forum where they used it to display recent pages in a widget (it used another plugin, PHP Text Widget).

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘List only a specific number of latest pages’ is closed to new replies.