We’ve recently created a simple set of shortcodes for our clients, so that they can add FAQs to their site.
The reason we chose shortcodes over a custom post type, is that CTP’s don’t allow for a custom order – as in not alphabetical, not ascending, not descending, not by date, but a custom human order.
Anyway, we created the following:
[faqs] renders the opening and closing tags of a definition list (dl).
[question] renders the definition title (dt).
[answer] renders the definition description (dd).
Obviously, semantically, we don’t want WordPress’s auto-p function to wrap the shortcodes with (p)’s, but we also don’t want to strip of the p tags, as an answer (definition description) can be made up of paragraphs and lists, etc.
What’s the best way to go here? How do we stop WordPress from wrapping shortcodes with paragraph tags?
Regarding custom post types ordering, another alternative is to use menu_order. Just include ‘page_attributes’ when you register the post type. The CMS tree page view plugin is nifty for dragging the items into the desired order.