archivo a editar
index.template.php
agregar al final antes de ?>
function schema_linktree(){
global $context, $shown_linktree;
// If linktree is empty, just return - also allow an override.
if (empty($context['linktree']))
return;
$schema = array(
'@context' => 'http://schema.org',
'@type' => 'BreadcrumbList',
);
// Each tree item has a URL and name. Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
$schema['itemListElement'][] = array(
'@type' => 'ListItem',
'position' => $link_num+1,
'item' => array(
'@id' => $tree['url'],
'name' => $tree['name'],
),
);
}
echo'
<script type="application/ld+json">
'.json_encode($schema, JSON_PRETTY_PRINT).'
</script>
';
}
justo antes de </body>
agregar
'.schema_linktree().'
resultado
(https://i.imgur.com/8YBuSBx.jpg)
pueden hacer su test en https://search.google.com/structured-data/testing-tool
Oh parece interesante y no requiere mucho, buena :P de paso lo movi a tutoriales!
Saludos!
Excelente, si lo mismo hicimos pero no del linktree sino de los post en si, en nuestra web que tenemos con Frony y lo estamos volviendo a levantar de a poco.
El mod que creamos fue justamente tener forma de mostrar como schema los post de ciertos foros y de acuerdo al tipo de schema que se quiere elegir, articulo, movie, etc.
Excelente Dhayzon