Ver Mensaje Individual
  #13 (permalink)  
Antiguo 04/06/2011, 11:42
Avatar de okdek88
okdek88
 
Fecha de Ingreso: julio-2009
Mensajes: 22
Antigüedad: 14 años, 9 meses
Puntos: 0
Respuesta: Paginación aleatoria (Por llamarlo de alguna manera)

Oye chicos, no hace falta ponerse tan agresivos.. realmente no pensé que fuese necesario, pero si estaba equivocado, pido disculpas por haceros perder el tiempo. No pienso que me vayáis a robar el código ni nada así. Buen rollo y tal :D

Y j_aroche, no me ha funcionado, me crea un enlace a /page/$randompage :S

Bueno, este es el index.php de mi theme (ET-Starter 1.4):
Código PHP:
Ver original
  1. <?php
  2.     global $options;
  3.         foreach ($options as $value) {
  4.             if (get_settings( $value['id'] ) === FALSE) {
  5.                 $$value['id'] = stripslashes( $value['std'] );
  6.             } else {
  7.                 $$value['id'] = stripslashes( get_settings( $value['id'] ) );
  8.             }
  9.         }
  10. ?>
  11. <?php get_header(); ?>
  12.  
  13. <?php /* Enables two or three columns */
  14. if ($et_threecolumn_disable == "false") { ?> <?php include(TEMPLATEPATH."/sidebar.php");?><?php } ?>
  15.  
  16.    <div class="content <?php if ($et_threecolumn_disable == "false") { ?> <?php echo $et_columnorder; ?> <?php } else { ?> content-two-column<?php echo $et_columnorder; ?> <?php } ?>">
  17.  
  18.     <?php if (have_posts()) : ?>
  19.  
  20.         <?php while (have_posts()) : the_post(); ?>
  21.  
  22.             <div class="post" id="post-<?php the_ID(); ?>">
  23.                 <h1><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1>
  24.                 <h2><?php the_time('F jS, Y') ?> | <?php the_category(', ') ?> | <?php comments_popup_link('0 Comments', '1 Comment', '% Comments'); ?></h2>
  25.  
  26.                 <div class="entry">
  27.                     <?php the_content('Read More'); ?>
  28.                    
  29.                     <?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?>
  30.                 </div>
  31.  
  32.                 <?php if (function_exists('the_tags')) { the_tags('<p class="postmetadata">Tags: ', ', ', '</p>'); } ?>
  33.             </div>
  34.  
  35.         <?php endwhile; ?>
  36.  
  37.             <div class="navigation">
  38.        
  39.             <div class="alignleft" class="linkleft"><?php previous_posts_link('<img src="left.png">') ?></div>
  40.        
  41.             <div class="linkcenter">
  42.  <?php $randomPost = $wpdb->get_var("SELECT guid FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' ORDER BY rand() LIMIT 1"); echo '<a href="'.$randomPost.'" title="Random"><img src="random.png" alt="Random"></a>'; ?>
  43.             </div>
  44.  
  45.                 <div class="alignright" class="linkright"><?php next_posts_link('<img src="right.png">') ?></div>
  46.                
  47.             </div>
  48.  
  49.     <?php else : ?>
  50.    
  51.         <div class="post">
  52.             <h2 class="center">Not Found</h2>
  53.             <p class="center">Sorry, but you are looking for something that isn't here.</p>
  54.         </div>
  55.  
  56.     <?php endif; ?>
  57.  
  58.     </div>
  59.  
  60.  
  61. <?php include(TEMPLATEPATH."/primary-sidebar.php");?>
  62.  
  63. <?php get_footer(); ?>

¡Gracias de nuevo por vuestro tiempo!