Support » Fixing WordPress » Disable scheduled post

  • Resolved nazzilla

    (@nazzilla)


    hi all!
    i need to disable scheduled post function
    I’ve post with future date (not today,not yesterday but) ,but i want show it from now,not wait scheduled date.
    there’s way to show post with future date?better if not via plugin
    tnx

Viewing 11 replies - 1 through 11 (of 11 total)
  • Show all future posts:

    <?php
    $args=array(
      'post_type' => 'post',
      'post_status' => 'future',
      'posts_per_page' => -1,
      'caller_get_posts'=> 1
    );
    $my_query = null;
    $my_query = new WP_Query($args);
    if( $my_query->have_posts() ) {
      echo 'List of Posts';
      while ($my_query->have_posts()) : $my_query->the_post(); ?>
        <p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
        <?php
      endwhile;
    }
    wp_reset_query();  // Restore global post data stomped by the_post().
    ?>

    Related:
    Stepping Into Template Tags
    Stepping Into Templates
    Template Hierarchy
    query_posts()

    nice!
    it work

    but
    i’ve other condition in the query, if i put this code before other i’ve 2 kind of query post
    i can disable it from the core or this is only one solution?

    Look at that query_posts link above for other condition. You can have it return both future and published posts if that’s what you are after.

    Also see:
    http://wordpress.org/support/topic/310862?replies=18

    in which way can be helpfull for me use define(‘DISABLE_WP_CRON’, true)?
    what kind of function it’s?
    what it did?

    Basically:I want show future and past post in same loop,
    or better , “say” to core when you post ignore the date sort/order, pls 🙂

    i hope you can undestand, my eng is terrible

    Change the $args to this:

    $args=array(
      'post_type' => 'post',
      'post_status' => 'future,publish',
      'posts_per_page' => -1,
      'caller_get_posts'=> 1

    ok work fine!
    now there’s other problem, if i what show post by category loop show all post, exatly i see index.php post like category.php, it’snt sort by category.
    you can see it here

    i forget, i use this code

    <?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_title(); ?></a></h2>
        <?php }; ?>
        <?php the_date('','<h4>','</h4>'); ?>
    	<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().
    ?>

    Yeah!
    but i prefer to use custom category-id.php, each for category,beacause i need to change visualization, and work with my last code posted 🙂
    thankz a lot!

    other problem
    in firefox i see correct single page if i click on a post
    but in other browser there’s error page not found

    try this page

    there’s a way to fix?
    i try to use cron, but dont work.What define(‘DISABLE_WP_CRON’, true) do exatly?

    i found solution to the problem,
    integrate your first code, with query_status
    and for show in single post i use this plugin
    http://wordpress.org/extend/plugins/show-future-posts-on-single-post/

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Disable scheduled post’ is closed to new replies.