• Hi.

    Looking for some kind of a way to display THREE random pages (out of more than hundred). Is there a way to Loop them? I need to get the_title, the_permalink and two Keys from each page.

    Help!

    — t.

Viewing 2 replies - 1 through 2 (of 2 total)
  • <?php $pages = wp_list_pages('title_li=&sort_column=post_date&sort_order=DESC&depth=-1&echo=0');
    preg_match_all('/(<li.*?>)(.*?)<\/li>/i', $pages, $matches);
    if (!empty($matches[0])) {
      print '<ul>' . implode("\n",array_slice($matches[0],0,25)) . '</ul>';}
    ?>

    from this topic
    http://wordpress.org/support/topic/116226

    🙂
    Rafael,
    [sig moderated]

    troglodyth

    (@troglodyth)

    Okay, i don’t understand anything of the response above, because i’m not into php (only html and css). But i need something very similar, a simple link on one of my pages, that takes the reader to a random specific page. I have a lot of pages on my site, but it’s only about 32, that i want to be chosen randomly with this link. What do i have to do?

    This topic didn’t help me: http://wordpress.org/support/topic/128133?replies=5
    Maybe this plugin helps me:
    http://wordpress.org/extend/plugins/get-random-page/#post-125
    But i’m not sure, because it’s not well explained, what it does and it seems nobody uses it.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Random Pages Listing’ is closed to new replies.