• @anmari I have a question about how amr shortcode any widget works.

    I am looking to insert a different version of the same widget into every post (same widget type but customized differently for each post). I have over 250 posts and growing. Each post would get just one shortcode, but the “Widgets for Shortcodes” widget area would need to have 250+ widgets in it (one for each post).

    Is there a performance concern with creating this many widgets in the “Widgets for Shortcodes” widget area (assuming only one shortcode per post is actually inserted)? Do they all load into memory or anything like that?

    Thank you so much.

    • This topic was modified 6 years, 11 months ago by wholesomeyum.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author anmari

    (@anmari)

    There is no particular reason that I know of why that would be a problem. If WordPress can handle 250 widgets in a sidebar then it should be fine. It’s really just an array lookup.

    • This reply was modified 6 years, 11 months ago by anmari.
    Plugin Author anmari

    (@anmari)

    Although… if you intend displaying all 250 posts at same time, then depending what the widget is doing, you may have a problem. EG: if it needs to do a DB query,then thats 250 queries!!!! In that case you’d be better off with a custom solution to the whole thing that fetches all the data you need in one query (including the posts) and then generates the html.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Performance for Large Number of Widgets’ is closed to new replies.