Ver Mensaje Individual
  #8 (permalink)  
Antiguo 16/06/2012, 12:29
blogdv
 
Fecha de Ingreso: julio-2010
Mensajes: 166
Antigüedad: 13 años, 9 meses
Puntos: 0
Pregunta Respuesta: Mostrar en el index las entradas publicadas hace 2 días

He leído, he investigado un poco y tal y no hay manera de dar con la solución...
He intentado meter el código que me dió Nekko en el index, antes del <?php if (have_posts()) : ?> pero en mi idex.php no aparecen entradas y aparece como si no las encontrara (Sorry, nothing found! These might be of interest though...).

No sé donde puedo tener el error..
Os dejo el código que utilizo:

Código:
<?php
get_header(); 
global $ap_options;
if ($ap_options['excerpt']) $showex = true;?>

<?php
      function filter_where($where = '') {
       $where .= " post_date = '" . date('Y-m-d', strtotime('-2 days')) . "'";
        return $where;
      }
    add_filter('posts_where', 'filter_where');
    query_posts($query_string);
    ?>

	<?php if (have_posts()) : ?>
		<?php $i = 0; //counter to determine class ?>
		<?php while (have_posts()) : the_post(); ?>
			<?php $i++;
				if (ap_isodd($i)) {
					$h2class = 'h2odd';
				}else{
					$h2class = 'h2even';
				}
			?>
			<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
                        <div class="title"><!--index -->
				<h2 class="<?php echo $h2class; ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
                        </div>

			</div>

		<?php endwhile; ?>
            
            <div class="navigation">
    		<div class="left"><?php previous_posts_link('&laquo; Anterior'); ?></div>
    		<div class="right"><?php next_posts_link('Siguiente &raquo;'); ?></div>
    		<div class="clear"></div>
            </div><!-- end navigation -->


	<?php else : ?>

		<div class="post">
				<div class="title">
					<h2>Sorry, nothing found!</h2>
				</div>
				<div class="clear"></div>
				<div class="entry no_result">
                              <br/>
                              <p>These might be of interest though...</p>
                              <ul>
                              <?php wp_get_archives('type=postbypost&limit=10'); ?>

                              </ul> 
                              
                              
				</div>
		</div><!-- end post -->

	<?php endif; ?>

	</div><!--end content-->


<?php get_footer(); ?>
Bueno haber si tenéis idea donde puede estar fallando porque esque no hay manera y mira que me estoy volviendo loco con esto...

Gracias

Última edición por blogdv; 17/06/2012 a las 03:20