Support » Plugin: amr users » Can you use multiple shortcodes on same page?

  • Resolved LS

    (@lsterling03)


    I’m using multiple shortcodes on a single page. It worked at first, but now it displays the same users for each shortcode, even though the parameters for each code are different. It seems to be taking the parameters of the first shortcode and repeating it for all the others on the page.

    This is what my code looks like:

    <h3>Region 1</h3>
    [userlist list=12 filter=1 dbem_region=1]
    <h3>Region 2</h3>
    [userlist list=12 filter=1 dbem_region=2]
    <h3>Region 3</h3>
    [userlist list=12 filter=1 dbem_region=3]

    I’m already using the Grouping add-on to group the users within each region by another subheading. So that’s why I’m grouping the regions with separate shortcodes. (I know I can also achieve this by creating a separate user list for each region, but there’s a reason I can’t do that for this list — so I’m trying to get it to work with the shortcode.)

    The above code DOES work if I visit the url with ?refresh=1 at the end of it, but it doesn’t work when you visit it normally. I’ve tried hitting the “Rebuild cache” on the list, but that doesn’t seem to have any effect.

    My cache settings are: No scheduled auto-cacheing.

    What could be causing this problem? Thank you.

    https://wordpress.org/plugins/amr-users/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter LS

    (@lsterling03)

    In case it helps anyone, this is how I worked around this issue:

    1. I put each of the 3 region shortcodes onto 3 separate pages, so I only had one shortocde per page.

    2. I created a special template to query of all those posts (like an archive page) so they would appear on the same page together.

    Somehow this makes it work. The shortcodes/lists are all still displayed on the same page, but they exist on separate pages initially.

    Perhaps the author has a better suggestion, but this works for now.

    (Again, I’ll remind you that I know you can do this with the Grouping add-on, but I’m already using groups within each region list… and you can only use one grouping per list.)

    Plugin Author anmari

    (@anmari)

    OMG – that all sounds rather complicated – I think it would have been a lot easier to just copy the lists and then use the include option to tailor each list to only show the subset that you want.

    Problems with your hack are possibly due to cacheing – there is a transient ‘page’ cache.

    Thread Starter LS

    (@lsterling03)

    It does sound complicated. But, if I made a separate list for each include I have, I’d have to make 64 different lists. So it’s simpler to make 3 lists, and then I can use the shortcode to filter from there.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Can you use multiple shortcodes on same page?’ is closed to new replies.