WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Future posts not showing on site (5 posts)

  1. GretarMagg
    Member
    Posted 1 year ago #

    Somehow the future posts I have on display on the top left and right sidebar on this page, http://www.vallaskoli.is have stopped appearing on the frontpage.

    I haven´t changed anything in my query, this is how it looks like.

    <ul>
    					<?php $summary=1; ?>
            				<?php query_posts('order=ASC&cat=7&post_status=future');
              					if(have_posts()) :
              						while(have_posts()) : the_post();
              							if(strtotime(get_the_time("F jS Y")) > time()) :
              								continue;
              							else: echo $post->id; ?>
            								<?php if($summary%2==0){ ?>
            									<li>
              										<?php }else{ ?>
              											<li class="odd">
                												<?php } $summary++; ?>
                												<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a>
              												<span class="date"><strong><?php the_time("l"); ?></strong>&nbsp;<strong><?php the_time("j"); ?>.&nbsp;</strong><?php the_time("F"); ?>&nbsp;<?php echo get_post_meta(get_the_ID(), 'Timasetning', true); ?></span>
            											</li>
              								<?php endif;
              						endwhile;
              					else: ?>
              						<li class="odd">
                							<?php echo "Engir atburðir á skrá!";
              					endif; ?>
              					</li>
    				</ul>
  2. esmi
    Forum Moderator
    Posted 1 year ago #

    You should not be using query_posts() for a secondary Loop. Use get_posts() or WP_Query().

  3. GretarMagg
    Member
    Posted 1 year ago #

    Could you maby help me with setting the query up with WP_Query() ?

  4. esmi
    Forum Moderator
    Posted 1 year ago #

  5. GretarMagg
    Member
    Posted 1 year ago #

    I figured this out with WP_Query ! Thank you !

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.