Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #392104

    Hi there,

    We are using the Enfold template and would like to add structured data so our social profiles will show. The structured data script is a little different that what’s used to generate Sitelinks, which the Yoast plugin already does.

    Here is an example of the script that needs to be inserted into the homepage.

    <script type=”application/ld+json”>
    { “@context” : “http://schema.org&#8221;,
    “@type” : “Organization”,
    “name” : “Your Organization Name”,
    “url” : “http://www.your-site.com&#8221;,
    “sameAs” : [ “http://www.facebook.com/your-profile&#8221;,
    http://www.twitter.com/yourProfile&#8221;,
    http://plus.google.com/your_profile”%5D
    }
    </script>

    Where within the WordPress panel do we need to go to insert this after appropriate edits?

    The Google link about this form of structured data is here: https://developers.google.com/webmasters/structured-data/customize/social-profiles

    #392328

    Hey Brandon!

    You can use a WordPress hook for that, try adding this at the very end of your theme / child theme functions.php file:

    function custom_func() {
    ?>
    <script type=”application/ld+json”>
    { “@context” : “http://schema.org”,
    “@type” : “Organization”,
    “name” : “Your Organization Name”,
    “url” : “http://www.your-site.com”,
    “sameAs” : [ “http://www.facebook.com/your-profile”,
    “http://www.twitter.com/yourProfile”,
    “http://plus.google.com/your_profile”]
    }
    </script>
    <?php
    }
    add_action('wp_footer', 'custom_func');

    Cheers!
    Josue

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.