• Resolved michaelxxx

    (@michaelxxx)


    Hi,

    I have been using your plugin for a long time. In the beginning it was enough to insert the shortcode simply like this into a post.

    [sc name="aida-norway"]

    At some point came the change that the shortcode also gets a closing bracket.

    [sc name="aida-norway"][/sc]

    1) Does the closing bracket have any important relevance or do both spellings generally work?

    2) If there can be problems without the closing bracket, can you use Search & Replace and a placeholder to replace the shortcode in all posts?

    Like this:
    Search for:
    [sc name="placeholder"]
    …and replace it with
    [sc name="placeholder"][/sc]

    What would be the correct sytax for the placeholder?

Viewing 1 replies (of 1 total)
  • Plugin Author vaakash

    (@vaakash)

    Hi @michaelxxx,

    Thanks for using Shortcoder.

    You can use the open shortcode too.

    When a post contains a mix of open and closed shortcodes, it is not possible to match which shortcode is for what.

    
    [sc name="hello"]
    paragraph 1
    
    [sc name="welcome"][/sc]
    

    Here, shortcode “welcome” won’t execute since it is wrapped between “hello” shortcode’s open and close sc tags.

    WordPress pairs up shortcode open/close tag with sc.

    I’ve seen issues where some users have a situation like this and some portion of the content is engulfed and not visible. Hence the change to close all shortcodes.

    If your post contains only open shortcodes then you can continue to use that. But mixing up both in one post will confuse the parsing.

    Thanks,
    Aakash

Viewing 1 replies (of 1 total)
  • The topic ‘Syntax of Shortcode’ is closed to new replies.