| Pivot stuff - introduction | Snippets | Download statistics | Poll | To Do list | For snippet authors | A heartfelt plea |
I don't know if this is off any use to anyone...
I created it when I noticed that many of my snippets had similar core functionality. You can download it here.
You can treat it as an example, if you are just learning snippet coding - although I certainly do not claim to be any sort of expert.
Alternatively, you can use it as a basis for any similar snippet.
It accepts parameters to indicate desired weblog,a uthor and category, allowing for wildcards, and loops through all entries selecting only published entries which match the desired weblog, author and category (feel free to add further checks, e.g. for date, etc).
Once you have located each entry, simply add your code; an example is given of how to generate an HTML URL with the text being the title of the post and the destination being the permalink of the post. (downloaded times so far)
snippet_conditional_begin and snippet_conditional_end. Basically, Bob told me how to code these. My big problem is where to show the (larger) output of some of my snippets. I could show the output on a new page, but I decided that I would like it in the 'frame' (centre column) of my blog's frontpage. Then I thought that if I had the output of a snippet there, I would rather not have the standard blog below it. I posted to the forum and Bob suggested this.
In my frontpage.html, I have:
as explained here:
You may also want to use get_posts_for_month, get_posts_for_category or get_posts as a building block for a new snippet, post-processing the output or presenting it in a different format.
| Pivot stuff - introduction | Snippets | Download statistics | Poll | To Do list | For snippet authors | A heartfelt plea |