• Since the 3.0 update, it appears my have_posts loop is returning my pages instead of my posts. The following code:

    <?php get_sidebar(); ?>
    		<?php if (have_posts()) : ?>
    		     <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts('paged=' .$paged);
    		     global $more;
    		     $more = 0;
    		     ?>
    		     <?php while (have_posts()) : the_post(); ?>
    			<div class="post">
    			    <h1><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h1>
    				<div class="meta">by <?php echo the_author_link(); ?>, <?php the_time(); ?> on <?php echo the_date(); ?> | <a href="<?php comments_link(); ?>"><?php comments_number('0 Comments','1 Comment','% Comments'); ?></a></div>
    			    <?php the_content('Read the rest of this entry &raquo;'); ?>
    			    <div class="meta meta-bottom"><a href="<?php comments_link(); ?>"><?php comments_number('0 Comments','1 Comment','% Comments'); ?></a> | Categories: <?php the_category('&nbsp;'); ?><a href="https://twitter.com/home?status=Currently%20reading:%20<?php echo the_permalink(); ?>"><img src="<?php bloginfo('template_url'); ?>/images/retweet.png" alt="retweet this" class="retweet-post" /></a></div>
    			</div><!-- end .post -->
    		<?php endwhile; else: ?>
    		<?php endif; ?>
    
    		<div class="pagination">
    			<?php
    
    			function show_posts_nav() {
    				global $wp_query;
    				return ($wp_query->max_num_pages > 1);
    			}		
    
    			?>
    			<?php if (show_posts_nav()) : ?>
    			<div class='navigation'>
    				<span class='older'><?php next_posts_link('&laquo; Older Entries'); ?></span>
    				<span class='newer'><?php previous_posts_link('Newer Entries &raquo;'); ?></span>
    			</div>
    			<?php endif; ?>
    		</div><!-- end .pagination -->

    Returns a blank entry with the title of my first page, Home. Should I add text to the home page, it shows within the template.

    Any idea where I’m going wrong here? Live site is at https://qworky.com/blog

    Permalinks to posts work, see: https://www.qworky.com/blog/2010/05/qworky-review-viral-loop/

    Thanks so much for any help.

Viewing 15 replies - 1 through 15 (of 36 total)
  • Thread Starter jpcody

    (@jpcody)

    And a bump, if no one minds ??

    Thread Starter jpcody

    (@jpcody)

    More details: disabling all plugins and reverting to the default theme does not fix the issue, either. So I’m guessing it’s some sort of config issue. Have reset .htaccess to no avail.

    So you switched to the WordPress Twenty Ten theme and when you look at what should be a list of posts you are seeing posts and pages. Assuming of course you did not try to use your code above.

    Thread Starter jpcody

    (@jpcody)

    That’s correct, Michael. I switched over to the Twenty Ten and Default themes after disabling all plugins, and I was still seeing only the first page instead of posts.

    But you see posts via admin->Posts->Posts and pages via admin->Pages->Pages?

    Thread Starter jpcody

    (@jpcody)

    Exactly.

    I have the same problem, my blog section is retrieving a page (main page) and doesnt show any posts

    So you’ve deactivate all plugins?

    What about renaming your .htaccess file?

    A link to see the problem with a title for a page and a title for a post.

    https://www.saudaveissubversivos.org/wp

    see the blog section, almost the same issue You have

    a post linked to homepage

    i deactivated all plugins, upload them again, upload entire WP 3.0 and nothing

    Thread Starter jpcody

    (@jpcody)

    Just renamed and regenerated .htaccess—no luck.

    Page with content screen shot: https://droplr.com/1fbIaq
    URL: https://www.qworky.com/blog/

    Thanks so much for your help, Michael.

    Thread Starter jpcody

    (@jpcody)

    Good to hear I’m not the only one with the issue, livresoft.

    <?php
    /*
    Template Name: Blog
    */
    ?>
    <?php get_header(); ?>
    <?php global $woo_options; ?>
    
        <!-- #content Starts -->
    	<?php woo_content_before(); ?>
        <div id="content" class="col-full">
    
        	<div id="main-sidebar-container">
    
                <!-- #main Starts -->
                <?php woo_main_before(); ?>
                <div id="main">      
    
                <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("paged=$paged"); ?>
                <?php if (have_posts()) : $count = 0; ?>
                <?php while (have_posts()) : the_post(); $count++; ?>
    
                    <!-- Post Starts -->
                    <?php woo_post_before(); ?>
                    <div <?php post_class(); ?>>
    
                        <?php woo_post_inside_before(); ?>
    
                        <?php woo_image('width='.$woo_options['woo_thumb_w'].'&height='.$woo_options['woo_thumb_h'].'&class=thumbnail '.$woo_options['woo_thumb_align']); ?> 
    
                        <h2 class="title"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
    
                        <p class="post-meta">
                            <span class="small"><?php _e('by', 'woothemes') ?></span> <span class="post-author"><?php the_author_posts_link(); ?></span>
                            <span class="small"><?php _e('on', 'woothemes') ?></span> <span class="post-date"><?php the_time($GLOBALS['woodate']); ?></span>
                            <span class="small"><?php _e('in', 'woothemes') ?></span> <span class="post-category"><?php the_category(', ') ?></span>
                        </p>
    
                        <div class="entry">
                            <?php the_excerpt(); ?>
                        </div>
    
                        <div class="post-more">
                            <span class="read-more"><a href="<?php the_permalink() ?>" title="<?php _e('Read full story','woothemes'); ?>"><?php _e('Read full story','woothemes'); ?></a></span> &bull;
                            <span class="comments"><?php comments_popup_link(__('Comments { 0 }', 'woothemes'), __('Comments { 1 }', 'woothemes'), __('Comments { % }', 'woothemes')); ?></span>
                        </div>                        
    
                        <?php woo_post_inside_after(); ?>
    
                    </div><!-- /.post -->
                    <?php woo_post_after(); ?>
    
                <?php endwhile; else: ?>
                    <div class="post">
                        <p><?php _e('Sorry, no posts matched your criteria.', 'woothemes') ?></p>
                    </div><!-- /.post -->
                <?php endif; ?>  
    
                    <?php woo_pagenav(); ?>
    
                </div><!-- /#main -->
                <?php woo_main_after(); ?>
    
                <?php get_sidebar(); ?>
    
    		</div><!-- /#main-sidebar-container -->         
    
    		<?php get_sidebar('alt'); ?>
    
        </div><!-- /#content -->
    	<?php woo_content_after(); ?>
    
    <?php get_footer(); ?>

    jpcody do you have a static front page set in Settings->Reading?

Viewing 15 replies - 1 through 15 (of 36 total)
  • The topic ‘have_posts getting pages instead of posts’ is closed to new replies.