tags:

views:

43

answers:

1

Hi,

I use two wp-queries on the front page of a website I'm working on. They each retrieve one post. The first query gets the latest post in the "News" category, and the second query gets the latest post from the blog excluding the "News" category.

This works fine.

However I cannot seem to get "Read more" to work. Is it because I don't use the standard query?

<div class="column_left">
<h3>Fresh news</h3>
<p><span class="date"><?php the_time('j F, Y') ?>. Timed <?php the_time('G:i') ?></span></p>
<?php
    $news = new WP_Query('cat=19&showposts=1');

    while ( $news->have_posts() ):
        $news->the_post(); 
        global $more;
        $more = 0;

        the_content('Read more &raquo;'); 
    endwhile;
?>
</div>

<div class="column_right">
<h3>Collected from the blog</h3>
<?php
    $blog = new WP_Query('cat=-19&showposts=1');

    while ( $blog->have_posts() ):
        $blog->the_post(); 
        global $more;
        $more = 0;

        the_content('Read more &raquo;'); 
    endwhile;
?>
</div>

Can you see what I'm doing wrong?

+1  A: 

If you want a Read more, then i would use the_excerpt, because this is the short one of your content, or you can use this:

<a href="<?php the_permalink(); ?>" title="Read More">Read More &raquo;</a>

in your example:

...

$more = 0;

echo get_content().'<a href="'.get_permalink().'" title="Read More">Read More &raquo;</a>'; 

endwhile;
ahmet2106