• Resolved rdmckelvey

    (@rdmckelvey)


    When I came in to work this morning a site I’m working on suddenly shows no posts on the home page (index.php). It only displays the “Sorry no posts matched your criteria” message. I swear it worked fine at the end of the work day yesterday.

    I’ve looked at the page using an array of other themes from the WordPress install and it’s the same – no posts on the home page. If I choose a category or search for post content, the posts show just fine in all the other page templates.

    I’ve read some older posts that mention issues with permalinks, but I’ve always had this set to the default.

    I updated to WordPress 3.3, but I’m sure the index.php page worked, at least for a while, after that.

    The development site is at: https://www.jamesriverwriters.dreamhosters.com

    Any thoughts are very much appreciated!

Viewing 6 replies - 1 through 6 (of 6 total)
  • I notice the page says ‘news and events’

    Are you using some sort of query for the front page in index.php?
    Have you assigned a static front page in settings->reading?

    Or is the front page supposed to show all posts?

    Thread Starter rdmckelvey

    (@rdmckelvey)

    Rev. Voodoo,

    The “News and Events” header is purely editorial. The client will post content of the news/event flavor once the site goes live.

    The front page is not static. It has a loop that came from another theme (I used the “beach” theme, which I’ve modified to suit my needs).

    The front page is to show a limited number of posts. There’s currently a limit of the last three and an omission of category 17…

    Here’s the code of the current index.php page:

    <?php
    /**
     * @package WordPress
     * @subpackage JRW
     */
    
    get_header(); ?>
    
    <?php get_sidebar(); ?>
    
    <div id="main" class="home_main">
    <div id="slider">
    	<a href="https://www.jamesriverwriters.org" target="_blank"><img src="<?php bloginfo("template_url"); ?>/images/slide_1.jpg" alt="" /></a>
    	<a href="https://www.jamesriverwriters.org" target="_blank"><img src="<?php bloginfo("template_url"); ?>/images/slide_2.jpg" alt="" /></a>
    	<a href="https://www.jamesriverwriters.org" target="_blank"><img src="<?php bloginfo("template_url"); ?>/images/slide_3.jpg" alt="" /></a>
    </div>
    <div id="main_center_column">
      <h1>News and Events</h1>
      <?php /* Start the Loop */ ?>
      <!-- Start the Loop. -->
      <?php query_posts($query_string . '&cat=-17&showposts=3'); ?>
      <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    
     	<div class="post">
    
     		<!-- Display the Title as a link to the Post's permalink. -->
     		<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
    
     		<!-- Display the date -->
     		<small><?php the_time('F jS, Y') ?></small>
    
      		<div class="entry">
        		<?php the_content(); ?>
      		</div>
    
      		<p class="postmetadata">Posted in <?php the_category(', '); ?></p>
     	</div> <!-- closes post div box -->
    
     <?php endwhile; else: ?>
     	<p>Sorry, no posts matched your criteria.</p>
     <?php endif; ?>
     </div> <!-- closes center_column div box -->
     <div id="right_sidebar">
        <ul id="tweets">
          <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Right Sidebar') ) : ?>
    				<?php endif; ?>
        </ul>
     </div><!-- closes right_sidebar box -->
    </div>
    <!--Extra DIV to house the floating illustration at the bottom of the page-->
      <div id="illustration_footer"></div>
    <?php get_footer(); ?>

    If you comment out that query, do you get posts displaying?

    We can at least try to narrow down the suspect (Other interference vs. query)

    Thread Starter rdmckelvey

    (@rdmckelvey)

    In writing that last post, it got me wondering what would happen if I didn’t limit the query_string to 3 posts and posts not from category 17. When I removed the query_posts line it started working.

    I added the limit of three posts back in and that worked.

    Now to see if I can successfully omit a category from the posts on the home page.

    I still wonder what changed in the past 24 hours… weird!

    you may be able to just limit posts and exclude the cat without the query string…. not sure

    Thread Starter rdmckelvey

    (@rdmckelvey)

    I haven’t untangled this mess entirely, but what I’m not seeing is that (I think) one of my plug-ins is wreaking havoc. I did reflexively update a bunch of plugins yesterday, one of which was WP-MeetUp. If I deactivate that, my other posts show up. If I reactivate it, all I see are a sampling of posts fed from the MeetUp page.

    What’s weird is that in my posts page on the dashboard, it says I have 43 posts of the category ‘event’ which came from MeetUp.com. If I click on the “43” or the category “events” it says there are no posts.

    The ‘posts” page says I have only the seven posts I entered manually to test things out.

    The WP-Meetup calendar says there are no events, yet the plugin feeds several MeetUp events to the home page.

    I’m baffled!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Index.php not showing posts’ is closed to new replies.