Fix structured data
This commit is contained in:
parent
02b9ce5901
commit
19bcdb6418
@ -559,7 +559,7 @@ function getStructuredData($type, $data = array())
|
|||||||
|
|
||||||
if ($type == 'software')
|
if ($type == 'software')
|
||||||
{
|
{
|
||||||
$ret = '<!-- Add structured data for blog post -->'."\n";
|
$ret = '<!-- Add structured data for software post -->'."\n";
|
||||||
$ret .= '<script type="application/ld+json">'."\n";
|
$ret .= '<script type="application/ld+json">'."\n";
|
||||||
$ret .= '{
|
$ret .= '{
|
||||||
"@context": "https://schema.org",
|
"@context": "https://schema.org",
|
||||||
@ -585,7 +585,7 @@ function getStructuredData($type, $data = array())
|
|||||||
$companyname = $mysoc->name;
|
$companyname = $mysoc->name;
|
||||||
$url = $mysoc->url;
|
$url = $mysoc->url;
|
||||||
|
|
||||||
$ret = '<!-- Add structured data for blog post -->'."\n";
|
$ret = '<!-- Add structured data for organization -->'."\n";
|
||||||
$ret .= '<script type="application/ld+json">'."\n";
|
$ret .= '<script type="application/ld+json">'."\n";
|
||||||
$ret .= '{
|
$ret .= '{
|
||||||
"@context": "https://schema.org",
|
"@context": "https://schema.org",
|
||||||
@ -597,9 +597,10 @@ function getStructuredData($type, $data = array())
|
|||||||
"@type": "ContactPoint",
|
"@type": "ContactPoint",
|
||||||
"contactType": "Contact",
|
"contactType": "Contact",
|
||||||
"email": "'.dol_escape_json($data['email'] ? $data['email'] : $mysoc->email).'"
|
"email": "'.dol_escape_json($data['email'] ? $data['email'] : $mysoc->email).'"
|
||||||
},'."\n";
|
}'."\n";
|
||||||
if (is_array($mysoc->socialnetworks) && count($mysoc->socialnetworks) > 0) {
|
if (is_array($mysoc->socialnetworks) && count($mysoc->socialnetworks) > 0) {
|
||||||
$ret .= '"sameAs": [';
|
$ret .= ",\n";
|
||||||
|
$ret .= 'sameAs": [';
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach($mysoc->socialnetworks as $key => $value) {
|
foreach($mysoc->socialnetworks as $key => $value) {
|
||||||
if ($key == 'linkedin') {
|
if ($key == 'linkedin') {
|
||||||
@ -613,7 +614,7 @@ function getStructuredData($type, $data = array())
|
|||||||
$i++;
|
$i++;
|
||||||
if ($i < count($mysoc->socialnetworks)) $ret .= ', ';
|
if ($i < count($mysoc->socialnetworks)) $ret .= ', ';
|
||||||
}
|
}
|
||||||
$ret .= '],'."\n";
|
$ret .= ']'."\n";
|
||||||
}
|
}
|
||||||
$ret .= "\n".'}'."\n";
|
$ret .= "\n".'}'."\n";
|
||||||
$ret .= '</script>'."\n";
|
$ret .= '</script>'."\n";
|
||||||
@ -684,7 +685,7 @@ function getStructuredData($type, $data = array())
|
|||||||
}
|
}
|
||||||
elseif ($type == 'product')
|
elseif ($type == 'product')
|
||||||
{
|
{
|
||||||
$ret = '<!-- Add structured data for blog post -->'."\n";
|
$ret = '<!-- Add structured data for product -->'."\n";
|
||||||
$ret .= '<script type="application/ld+json">'."\n";
|
$ret .= '<script type="application/ld+json">'."\n";
|
||||||
$ret .= '{
|
$ret .= '{
|
||||||
"@context": "https://schema.org/",
|
"@context": "https://schema.org/",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user