• Resolved nazzilla

    (@nazzilla)


    hi
    i use custom code for show future post
    code for index.php

    <?php
    $args=array(
      'post_type' => 'post',
      'post_status' => 'future,publish',
      'posts_per_page' => -1,
      'caller_get_posts'=> 1
    );
    $my_query = null;
    $my_query = new WP_Query($args);
    if( $my_query->have_posts() ) {
      while ($my_query->have_posts()) : $my_query->the_post(); ?>
        <div id="post-<?php the_ID(); ?>" class="post">
    	<?php
    	$category = get_the_category();
    	$currentcat = $category[0]->cat_name;
    	?>
    	<?php if ($currentcat == "news"){ ?>
    	<h2 class="storytitle"><?php the_title(); ?></h2>
    
        <?php } else { ?>
        <h2 class="storytitle"><a href="<?php the_permalink() ?>" rel="<?php the_title(); ?>"><?php the_date(); ?> - <?php the_title(); ?></a></h2>
    
        <?php }; ?>
    
    	<div class="storycontent">
    		<?php the_content(__('(more...)')); ?>
    	</div>
    	<div class="back-top"><a href="#topmenu" title="back to top">Back to top</a></div>
    	</div>
    
        <?php endwhile; } else { ?>;
    	  <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
    <?php }
    wp_reset_query();  // Restore global post data stomped by the_post().
    ?>

    but i’ve a problem with browser different to firefox,
    post dont show content and return me error
    for single.php i use this code

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    <div <?php post_class() ?> id="post-<?php the_ID(); ?>">
    	<h2 class="storytitle"><?php the_date(); ?> - <?php the_title(); ?></h2>
    
    	<div class="storycontent">
    		<?php the_content(__('(more...)')); ?>
    	</div>
    	<div class="back-top"><a href="#topmenu" title="back to top">Back to top</a></div>
    
    </div>
    
    <?php endwhile; else: ?>
    <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
    <?php endif; ?>

    try to open with firefox this
    and try to open with other browser this

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

The topic ‘single.php doesnt work with scheulde post’ is closed to new replies.