Hello Darren,
I had a look at your website. The map is not showing on the homepage, because the necessary JavaScript and CSS aren’t included in the page. The div is supposed to be empty; it is filled with the map content by Leaflet’s JavaScript.
If the JavaScript and CSS aren’t loaded in the page, it is most likely that the shortcode detection is failing, and indeed that is why the ‘tsscripts’ shortcode was invented. Is that shortcode included in the page at this time?
The only way I have seen so far that the shortcode detection fails, is when a WP plugin changes the main WordPress query, for example if a plugin assembles a page or post from different other pages and posts. Most likely an incompatibility with another plugin. Does your homepage utilize a plugin that possibly changes the WP query?
Let me try to clarify what is means, just in case.
If you request a page from WordPress, for example your homepage, WordPress constructs an internal ‘query’, to determine what content to display. Usually this is one or more pages or posts (in case of a homepage, it’s usually multiple posts). Trackserver uses this query to inspect all the content and see if the ‘tsmap’ shortcode is used, and only loads JS and CSS if that is the case.
Now, it is possible for a page or post to change the WP query (or do a sort of subquery) to gather other content, usually as the result of another shortcode. Trackserver does not (and cannot) know this, so if the post or page that contains the ‘tsmap’ is actually included in the content by means of another shortcode, shortcode detection fails and the map is not displayed.
The way the ‘tsscripts’ shortcode is meant to work, is to include it in the outermost page or post, i.e. the page that is actually present in the main WP query, regardless of other plugins or shortcodes.
Of course I don’t know how your homepage is constructed, but it shoud be possible to include ‘tsscripts’ in the main page and Trackserver should work. Please let me know if you need further help, and of course I’d be interested if this solved your problem.
Best regards,
Martijn.
-
This reply was modified 8 years, 1 month ago by
tinuzz. Reason: Typos
-
This reply was modified 8 years, 1 month ago by
tinuzz.