Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End WPautop messing with WordPress shortcodes

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #34531
    jonedwards
    Participant

    Hi guys

    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]
    • [question]
    • [answer]

    [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?

    By the way, I am already using TinyMCE advanced.

    Thanks in advance.

    Jon

    #88945
    jonedwards
    Participant

    Anyone??

    #88973
    TheDoc
    Member

    You could try something like this: http://www.simonbattersby.com/blog/2011/02/wordpress-wrapping-shortcodes-with-p-tags/

    There seems to be quite a few other results in Google and on the WordPress forums.

    #104860
    mcdonna
    Member

    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.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Back End’ is closed to new topics and replies.