[SOLVED] Help modifying the loop with several parameters
Hi all! Sorry to ask this, I guess it's more a PHP question than strictly an atahualpa question but I've been trying to figure it out for a few hours and it is starting to do my nut in! :p
I have a loop at the top of my page to show only posts from category 3. I am trying to create a second loop underneath this that: Shows one post only, that post being the latest sticky post if a sticky post exists, otherwise just the most recent post, but excluding category 3. I am using the following code right at the bottom of 'Content above the loop' and it works perfectly to show one post, sticky if present, but have not yet been able to exclude category 3. Code:
<?php $args = array( Code:
<?php $args = array( and it also stops the second loop from working. I also tried concatenating 'cat=-3' with $args but got a similar error. Can anyone see anything wrong with my syntax or method for excluding category 3? Any suggestions greatly appreciated! |
I should add that this works fine on its own to exclude cat 3 from the main loop:
Code:
<?php if (is_front_page() && !is_paged() ) $posts = query_posts($query_string . '&cat=-3&showposts=1'); ?> |
you are missing a comma after
HTML Code:
ignore_sticky_posts' => 1 HTML Code:
<?php $args = array( |
Thanks so much! Can't tell you how frustrating and satisfying it is to solve that so easily ;)
|
All times are GMT -6. The time now is 01:37 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.