[wp-hackers] Proper method for creating custom query inside shortcode

Claude Needham gxxaxx at gmail.com
Wed Aug 10 06:50:56 UTC 2011


I would like to embed an archive of the five most recent posts for a
particular category in the main content of a page.

I have managed to do this with some success by editing the page template.

However, it would be better to do this via a shortcode -- so that page
content can appear before and after the archive.

I've done this wrong in two different way.

When I managed to create an infinite loop, I decided it was time to
see if there is example code or at least a clue about the proper
method
for implementing a custom query within the main content of a page.

Any pointers would be appreciated.

Regards,
Claude Needham


More information about the wp-hackers mailing list