• Resolved Roger Correia

    (@correiar)


    I am using shortcoder to insert canned text on pages. The shortcode has a time field that is passed to the shortcode using the parameter %%time%%. I would like to highlight in color the time when the shortcode content is displayed.

    When I add any styling to the text, it fails to display. I can use {strong}{/strong} but no other styling.

    Any ideas or suggestions?

    • This topic was modified 3 years, 7 months ago by Roger Correia.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author vaakash

    (@vaakash)

    Hi @correiar,

    Thanks for using Shortcoder.

    Shortcoder prints the “shortcode content” as is.
    So if the output is not as you expect it might be some issue with the code you are using. May be in your case some styling/formatting/theme override issue. Shortcoder has no knowledge about the content/code pasted inside it.

    If you need help figuring out the issue with the code, please share the complete shortcode content, the page URL where shortcode is inserted here.
    I’ll have a look and point out the issue.

    Thanks,
    Aakash

    Thread Starter Roger Correia

    (@correiar)

    I have inserted the shortcode twice on this test page. The first instance works and the second does not. These are the shortcodes inserted:

    <p>[sc name=”judging_deadline” award=”single scoring image in the competition” time=”9:00 pm on Tuesday, September 28, 2021” ]</p>

    <p>[sc name=”judging_deadline” award=”single scoring image in the competition” time=”<span style=”color: #99cc00;”>9:00 pm on Tuesday, September 28, 2021</span>” ]</p>

    Here is a link to the test page: https://tdpc.ca/test-shortcoder/

    Thread Starter Roger Correia

    (@correiar)

    Any further insights after the information I sent you?

    Plugin Author vaakash

    (@vaakash)

    Hi Roger,

    Sorry for the delay. I missed to reply.

    The issue is that there is a double quotes inside double quote like below.

    time=<span style=color: #99cc00;>9:00 pm on Tuesday, September 28, 2021</span>

    The shortcode parser cannot work with this as a value. Below are my suggestions

    1) Have the HTML inside the shortcode content instead of passing as parameter

    2) Use single quotes either outside or inside the parameter i.e time="<span style='color:red'>HELLO</span>" (note the single quote between color:red) or vice versa

    Thanks,
    Aakash

    Thread Starter Roger Correia

    (@correiar)

    Terrific… I should have caught that myself. Thanks for the prompt response!

    Plugin Author vaakash

    (@vaakash)

    Cheers !

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Add color to shortcode parameters passed’ is closed to new replies.