Number of posts returned by query
I’m doing a filtered query:
add_filter('posts_where', 'filter_where'); query_posts ($query_string . '&cat=457');
filter_where is a time filter. As you can see, I’m pulling posts from a certain category during a certain timeframe.
What I want is to know at this point whether any posts fit the query, whether it returned any hits. If it did, the posts will go in one place (in a magazine-like format); if it didn’t, they go to another. I figured that I’d be able to do a simple “if N >0 do this, if N=0 do that” — but I can’t figure out what function to use to get N.
Thanks in advance.
- The topic ‘Number of posts returned by query’ is closed to new replies.