I would do that directly in a new template and do a search via the API search, getInitialResults.
Then you get an array containing all the required values. Also the number of posts.
Just look at the templates for an example:
widget_blognodes
widget_search_results
..and use debugvardump to get dump of the array.
Edit: Your query is not taking care of any permission or closed status. The search will ...
|