• Hi,

    I am currently using the following theme from: https://www.press75.com/folio-elements-theme-demo/

    The loop from the index.php pulls up the number of posts I want but the focused post only shows the 2nd most up to date post. I’ve tried tweaking query_posts to use “&orderby=date” as well other changes but it keeps showing the 2nd post.

    Anyone know or have any idea what I can adjust to make it show the latest?

    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter ispideyi

    (@ispideyi)

    Sorry, here is the code inside the index.php

    <?php get_header(); ?>
    
    <div id="content">
    
    <div class="carousel main">
    
        <a href="#" class="prev">&nbsp;</a>
    
        <div class="rotate">
    
            <ul>
    
            	<?php query_posts('showposts=10' . "&orderby=date"); ?>
    
    			<?php if (have_posts()) : ?>
    
                <?php while (have_posts()) : the_post(); ?>
    
            	<li>
    
                	<a href="<?php get_content('post', $post->ID); ?>" rel="facebox" title="<?php the_title_attribute(); ?>"><img src="<?php echo get_thumbnail($post->ID); ?>" alt="<?php the_title_attribute(); ?>" /></a>
    
                    <div class="intro">
    
                    	<h3><a href="<?php get_content('post', $post->ID); ?>" rel="facebox" title="<?php the_title_attribute(); ?>"><?php the_title() ?></a></h3>
    
                        <?php the_excerpt(); ?> 
    
                    </div>
    
                </li>
    
                <?php endwhile; ?>
    
                <?php else : ?>
    
                <?php endif; ?>
    
            </ul>
    
        </div>
    
        <a href="#" class="next">&nbsp;</a>
    
    </div>
    
    </div>
    
    <?php get_footer(); ?>

    The most likely cause–I see nothing in that code that’s obviously doing it–is the query_post loop. query_post loops can easily get thrown off if you’re trying to use more than one loop on a page. That’s why it’s been recommended for a while that you make your own loop, with WP_Query.

    Thread Starter ispideyi

    (@ispideyi)

    I’ve been looking over source of the pages and it does appear that the first post is being pulled properly as the first post in the page.

    It might be the javascript that loads the sliding posts that is loading the 2nd post instead.

    I’m gonna try to look into this to see if I can make adjustments via the javascript route. Thanks for the recommendation anyways.

    Thread Starter ispideyi

    (@ispideyi)

    Alright, it appears that the loop was never the issue as I previously figured out. It was the javascript file that was loading the previous post. I’ve made the proper adjustments and fixed it.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘loop won’t show first’ is closed to new replies.