94 reputation
112
bio website
location Netherlands
age
visits member for 2 years, 11 months
seen Apr 29 at 8:30

Mar
19
awarded  Announcer
Oct
15
awarded  Notable Question
Jan
18
awarded  Self-Learner
Jan
3
awarded  Popular Question
Sep
5
awarded  Commentator
Sep
5
comment Custom Fields Not in Search Results
This code does not work at all, beware!
Jun
10
awarded  Student
Mar
14
comment Counter problem, infinite loop when post_per_page equals X
Also, try removing the && $query->have_posts() from the if statement near the end of the code; that will always be true as you are within the while ($query->have_posts()) loop...
Mar
14
comment Counter problem, infinite loop when post_per_page equals X
I think you should be able to use only one counter, you are keeping track of every fourth post in any case, so that ( $count % 4 ) == 0 should be true for every 4th post, as long as you start from 1 (i.e., the way you're doing it now, as you're incrementing the variable before checking its value). Also, I noticed that you increment $c before initializing it, which can lead to unexpected things. To try to debug this further, you can add some statements like <?php echo $c. '<br/>'. $counter ?> within the code to see how the loop is going.
Mar
14
comment Counter problem, infinite loop when post_per_page equals X
Can't comment above, but I think you're mixing $c and $count in your code.
Mar
14
comment Counter problem, infinite loop when post_per_page equals X
Can you post how does the loop continue? do you have a while ( $query->have_posts() ) next?
Mar
14
answered Counter problem, infinite loop when post_per_page equals X
Feb
23
revised Adding a Taxonomy Filter to Admin List for a Custom Post Type?
a filter should return an object, so the return $query was missing as reported by a commenter
Feb
23
suggested suggested edit on Adding a Taxonomy Filter to Admin List for a Custom Post Type?
Feb
17
awarded  Scholar
Feb
17
accepted Prevent post from being published if custom fields not filled
Feb
17
answered Prevent post from being published if custom fields not filled
Feb
17
awarded  Supporter
Feb
17
awarded  Organizer
Feb
17
revised Disable qTranslate by post type in admin + disable per page / post ID on front-end
added specific plugin tag