WordPress.org

Ready to get started?Download WordPress

Forums

Post Snippets
[resolved] How to add shortcode with content (6 posts)

  1. dashaluna
    Member
    Posted 3 years ago #

    Hello,

    How can I add a post snippet that would output a shortcode with the default content and closing tag, like so:
    [quote by="" from=""] Please type the actual quote here. [/quote]

    If I create a post snippet with 2 parameters, then it only outputs [quote by="" from=""] without a closing tag.

    I've tried adding the whole string [quote by="{by}" from="{from}"] Please type the actual quote here. [/quote] to the Snippet field in the admin, but it still only outputs [quote by="" from=""].

    How can I add the whole shortcode with a default content and closing tag.

    Many thanks,
    Dasha

    http://wordpress.org/extend/plugins/post-snippets/

  2. Johan Steen
    Member
    Plugin Author

    Posted 3 years ago #

    Hi,

    Ah, I see you want to use an enclosing shortcode. At the moment the plugin only supports creating self-closing shortcodes. ie it supports [shortcode attri=""] but not [shortcode attri=""]content[/shortcode].

    Supporting enclosing shortcodes would probably be useful though, so thanks for bringing it up. I'll see if I can include it for the next update.

    Cheers,
    Johan

  3. dashaluna
    Member
    Posted 3 years ago #

    Hey Johan,

    Thanks for letting me know. Yes, that functionality would be really really helpful :)

    Keep me updated on it.

    Thanks,
    Dasha

  4. Johan Steen
    Member
    Plugin Author

    Posted 2 years ago #

    Hey,

    I just wanted to let you know that I've now updated the plugin to v1.8.2 which can handle enclosed shortcodes. When having text enclosed between the shortcode tags, that text is now available by using {content} in your snippet. The {content] variable is automatically assigned so don't set it in your variables field.

    Cheers,
    Johan

  5. NilsHolmstrom
    Member
    Posted 2 years ago #

    Hi!

    I am wondering if the plugin will support adding closing-shortcode via the TinyMCE-button?

  6. Dreadpoule
    Member
    Posted 2 years ago #

    Hello ! When I put {content} in my shortcode, it's used like simple text, {content} appears in my page instead of the content selected.
    Can you help me ?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic