Tagged: enfold
Hi,
I would like to add Google’s Sitelinks Search Box code to homepage (and only to the homepage):
https://developers.google.com/webmasters/structured-data/slsb-overview
How can I proceed?
Cheers,
Gee Are
Hi Gee Are!
It looks like they give you all the instructions there.
For step #2 you can add this to the bottom of your functions.php file to add it to your homepage.
add_action( 'wp_footer', 'enfold_customization_footer_scripts' );
function enfold_customization_footer_scripts() {
?>
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "WebSite",
"url": "https://www.example-petstore.com/",
"potentialAction": {
"@type": "SearchAction",
"target": "https://query.example-petstore.com/search?q={search_term_string}",
"query-input": "required name=search_term_string"
}
}
</script>
<?php
}
Best regards,
Elliott
hello
can you precise your answer
what function.php are you talking about?
The function.php ? or
theme function php (enfold/functions.php)?
please give an accurate answer
best regards
Hey!
Functions.php file of the theme that you can edit in Appearance > Editor tab
Regards,
Yigit
Thanks Yigit