Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • correiar
    Participant

    I have create a simple text-based shortcode. I want to reuse the shortcode on several pages and pass in different custom parameters. Here is shortcode text: https://ibb.co/LkyqJn8

    Here is the page that calls the shortcode: https://ibb.co/Sn2XQwB

    Here is the resulting output: https://ibb.co/zxNvgg7

    What am I missing?

    Hi Correiar,

    WordPress’s shortcode itself has a limitation where it does not work well with nested shortcodes. See link below .
    https://codex.wordpress.org/Shortcode_API#Nested_Shortcodes

    In you case things are considered as nested because [sc name="judging_guidelines] is seen back to back.

    So wordpress thinks that the 2nd shortcode is nested inside the 1st shortcode.

    I would recommend closing the first shortcode with [/sc] or have only one shortcode at the first place.

    Thanks,
    Aakash

    correiar
    Participant

    I closed out the first shortcode as you suggested and this time the second shortcode accepted the first custom parameter, but not the second one. The second custom parameter showed up as blank.

    Hi,

    Please avoid formatting inside parameter value. That will break the shortcode syntax. I see you have bold text for the 2nd parameter.

    To get it right easily, please switch to “text” editor while editing the post and then insert/edit the shortcode.

    If you want to bold the text, please do the formatting in the shortcode content.

    In the end just make sure the syntax of the shortcode is like in the link below. https://www.aakashweb.com/docs/shortcoder/getting-started/

    Thanks,
    Aakash

    correiar
    Participant

    I have it working now, thanks!

    Cheers !

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.

Subscribe for updates

Get updates on the WordPress plugins, tips and tricks to enhance your WordPress experience. No spam. View newsletter