I created this script and it validated fine in the Structured Data Testing Tool: http://data.co-op.place/pls/coop/p_seo_portal.therapists_object?in_portal_id=7047
it delivers:
{
"@context": "http://schema.org",
"@type": "ItemList",
"itemListElement": [
{
"@type": "ListItem",
"position": "1",
"url": "http://co-op.place/en_us-counsellors-taylorcreek/brittany-berg/"
}
,
{
"@type": "ListItem",
"position": "2",
"url": "http://co-op.place/en_us-counsellors-taylorcreek/craig-hollis/"
}
]
}
I then added it to the following wordpress page: http://co-op.place/en_us-counsellors-taylorcreek/ like so:
<script type="application/ld+json" src="http://data.co-op.place/pls/coop/p_seo_portal.therapists_object?in_portal_id= 7047">
When I test http://co-op.place/en_us-counsellors-taylorcreek/ in the Structured Data Testing Tool, I get JSON-LD Syntax error: value, object or array expected.
If I add the script directly to the page, I it validates correctly. However adding it directly won't work since the script can change over time. As new counsellors are added over time, the script will also deliver those new counsellors.
I'm at a loss as to why the using the script tag fails. Any ideas?