• Resolved jwesseldyke

    (@jwesseldyke)


    One of my sites uses a template page to pull in both static and dynamic content on the home page. It worked fine until I upgraded to 2.7. Now the home page displays blank. No error, no sign of any design. Just a blank page.

    Going directly to another page on the site pulls up the site just fine (so it’s not a theme issue) and for the moment I’m using a different page as the home page…

    Since I’ve narrowed it down to my template file, I’m curious to know if my template is just outdated with the newest release or what else could be the issue… The code that seems to be causing the trouble is below… Any ideas?

    <h2>What's Happening at Faith</h2>
    
    <?php $temp_query = $wp_query; ?>
    <?php query_posts('category_name=faith-reformed-news&showposts=3'); ?>
    <?php while (have_posts()) : the_post(); ?>
      <div class="post" id="post-<?php the_ID(); ?>">
        <h3><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h3>
        <?php the_content(); ?>
      </div>
    <?php endwhile; ?>
Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter jwesseldyke

    (@jwesseldyke)

    Thanks for the reply, Michael…
    Looks like a similar issue to my non-expert eye, but it looks like he’s using a different method to query posts… He’s also using cat #’s… Whether or not it’s the same thing I can’t tell…

    And in either case, it looks like that issue is unresolved… ??

    Thread Starter jwesseldyke

    (@jwesseldyke)

    OK… I found the solution, in this case, anyway…

    I changed:

    <?php query_posts('category_name=faith-reformed-news&showposts=3'); ?>

    to:
    <?php query_posts('category_id=3&showposts=3'); ?>

    Seems to have cleared up the issue…

    This looks like this problem is reported and has a patch on Trac ticket 8619.

    to jwesseldyke,
    this code :


    <?php query_posts('category_name=faith-reformed-news&showposts=3'); ?>

    isn’t resolve the problem.
    any ideas?

    I have a little solution, let me show to you… You can use this code, while wp’s coder fixing the bug ??

    $my_query = new WP_Query('cat=1&order=DESC&showposts=5');
    if ($my_query->have_posts()) {
        while ($my_query->have_posts()) : $my_query->the_post(); ?>
           ENTER YOUR LOOPING CODE
        <?php endwhile;
    }

    Perhaps it has a little problem in query_posts(); sintax.
    *waiting for bug fixing* ??

    packetsnuke, you saved my bacon! I have just encountered the same bug with version 2.7.1, where a call to query_posts with category id or name rendered the page blank in all browsers. Works fine in 2.7.0 as i’ve used it on another site successfully. I’ve used your solution and it works perfectly, my deadline is looming and the last thing I needed was having to rethink my templates!!

    **STAR**

    Thanks :)))

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘static/dynamic page with 2.7 with query_posts & category_name=’ is closed to new replies.