WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] shortcode, cant have same plugin twice on a page (4 posts)

  1. rickardl
    Member
    Posted 3 years ago #

    I have written a plugin for wordpress that uses shortcode.

    I am then using this on a page like so

    [fetch-reviews id="1"]

    and it displays beautifully, I can also change id to "2" and get the correct display there (different users).

    however when I add both like so (on the same page)

    [fetch-reviews id="1"]
    [fetch-reviews id="2"]

    It displays nothing at all.

    If I add both of them like this instead

    [fetch-reviews id="1"][/fetch-reviews]
    [fetch-reviews id="2"][/fetch-reviews]

    the first one is displayed, but the second one is not displayed at all.
    What am I doing wrong?
    So in the above example the one for user 1 is printed. If I swap them around like so

    [fetch-reviews id="2"][/fetch-reviews]
    [fetch-reviews id="1"][/fetch-reviews]

    the reviews for user two is printed but nothing for user 1.

  2. Mike Little
    Member
    Posted 3 years ago #

    It sounds to me like the shortcode parser is getting confused. Try separating them with a blank line.

  3. rickardl
    Member
    Posted 3 years ago #

    Ahh it was only an example in the actual page they arr in a list with some elements between them

  4. rickardl
    Member
    Posted 3 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic