Forums

Recent Posts are not recent on certain pages (1 post)

  1. 19dozen
    Member
    Posted 8 months ago #

    Hi there,

    I coded a widget that pulls out the latest posts in a particular category. It's basically the same as the default Recent Posts widget and I'm getting the same problem with that. The site is http://supplieshouse.2gui4u.com/ and if you go there you'll see that it appears to be working (on the right hand column of the site).

    If, however, you go to one of the supplier pages (for example http://supplieshouse.2gui4u.com/supplier/diversey/), it is not pulling out the correct post. It looks like it's actually the first news item that's being displayed. The code I'm using for the query is below:

    $queryargs = array('orderby' => 'date', 'order' => 'DESC', 'showposts' => $amount);
    
    					if($cat) if($cat > 0) $queryargs['cat'] = $cat;
    					$recent = new WP_Query($queryargs);

    Does anyone know why this might be happening. As I said, the same thing is happening with the default 'Recent Posts' widget as well.

    All the best,

    19Dozen

Reply

You must log in to post.

About this Topic