WordPress.org

Ready to get started?Download WordPress

Forums

Random Redirect plugin how to add random page functionality? (2 posts)

  1. r3volution11
    Member
    Posted 6 years ago #

    Can anybody help me with added random page functionality to this plug-in?

    I'm trying to convert WordPress into an Ad Server for my company and I'd like to take advantage of the page templates to allow for different style sheets when needed (white ad/white background, black ad/black background).

    Any help will be greatly appreciated.

    http://wordpress.org/extend/plugins/random-redirect/

  2. locworks
    Member
    Posted 5 years ago #

    Under 2.7 with the Tarski theme, I used the hack posted by Alan Edwardes on his blog.

    The hack originally works for posts, but it appears that changing

    WHERE post_type = 'post' AND post_password = '' AND post_status = 'publish' ORDER BY RAND() LIMIT 1");
    to
    WHERE post_type = 'page' AND post_password = '' AND post_status = 'publish' ORDER BY RAND() LIMIT 1");

    does the job on my blog here.
    The link to the random page is http://www.locworks.pl/11/random/

    Best regards,

    Piotr

Topic Closed

This topic has been closed to new replies.

About this Topic