What I’ve done is create 50+ absolutely placed divs of 40x40, make them transparent, and then attach 50+ popovers to them…
However, as you can guess, this has created quite a sloggish page because of the enormous code listing 50+ divs and popovers I reckon.
Would someone know how to recreate this but make it more efficient?
One way I thought could work is create a filter where all 50+ absolutely placed transparent divs act as options that return a URL parameter that is then input in 1 query, showing the correct unit (because I’ve got all units loaded in as CPT). But I don’t actually know how to do this
The page runs fine when going through a 6x CPU slowdown in my tests.
Is it the page load that is worrying you?
I see you are making 50+ queries to accomodate every popover.
I suggest installing a plugin like Query Monitor – WordPress plugin | WordPress.org to measure the server performance.
Don’t hesitate to share the monitor details so we can see where the hiccup might be.
So basically I’m just measuring by noticing the load time. It is more than double the load time for other pages I’ve created on this website.
the data for the popovers is dynamical, i’ve located a specific CPT (‘unit’) to a query so that when units are changed in the backend they automatically update in this map
basically im noticing that its slower than other pages on this website,
and in general i do think this could be more efficient. as in; 1 popover that has a query that automatically uses the correct CPT as input by for example the hover creating a class or something for each unit?
And what do you mean custom fields instead of CPTs?
my main aim is creating a market map with units that on hover show more info.
I thought so far the best way to do this is by creating a popover on an absolutely placed transparent div with a query inside linked manually to the corresponding unit. Then i can show this particular unit’s info through the query that provides the info. i didn’t think i could link a custom field to a particular CPT right?