SHARE
TWEET

Re-direccionar de forma aleatoria WordPress [Israel Pérez]

a guest Dec 12th, 2019 189 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. $args = array(
  4. 'posts_per_page' => 1,
  5. 'orderby' => 'rand'
  6. );
  7.  
  8. $random_redirect = new WP_Query ( $args );
  9.  
  10. while ( $random_redirect->have_posts () ) {
  11. $random_redirect->the_post ();
  12. wp_redirect ( get_permalink () );
  13. exit;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top