In the interest of making my code as readable as possible, I have structured some coding as follows:
$args = array (
'type' => 'post',
'posts_per_page' => 1,
'offset' => 1,
'category_name' => 'news',
);
$lastBlog = new WP_Query($args);
Does anyone see a problem with this coding? For some reason, my 'category_name' argument is not being recognised and causing the whole code to not be recognised. As a method of elimination process, I removed the 'category_name' => 'news', statement and the remaining coding then become recognised.
Any suggestions on where I am going wrong? I have also tried targeting category ID but still run into the same issue.
Thanks.
Craig