-
Notifications
You must be signed in to change notification settings - Fork 471
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
storefront functions [json+ld] #620
Comments
I'm not sure what to change in https://github.com/woocommerce/storefront/blob/master/inc/storefront-template-functions.php#L934 in order to get the |
The structured date output is not present only in single pages/posts/products. It's also outputted to the homepage, archives, search results, etc. For that reason, adding support for I'll into this asap. |
@tiagonoronha ah. When I looked at the WP image function used, it seemed it was just getting the featured image of a post. Ofc you could get all the images. I didn't know how that played out. I should have tested my code commit. |
Also this is how a category page should be written up. https://json-ld.org/playground/#/gist/c735f8a1c4f14523227e4064bfb61acb Maybe you can detect if yoast seo is installed. That plugin sets up the organization. We can just hook into it with an '@id` url fragment. The |
The main takeaway is there should never be more than one top level entity. A category page is a collection of like entities expressed in a nested entity of listitems that further have nested entities of product and offer. A product page will be coming up this week. I added notes here since this function controls json+ld everywhere. |
@tiagonoronha guideline for a product page. https://json-ld.org/playground/#/gist/0453ffd28f753ec202501283b496947c |
I'd not use the above mentioned template for category pages but https://output.jsbin.com/vucuvex instead. |
@jvandriel I think it's the exact same. But, using json playground. jsbin seemed to be running rather sluggish for me? |
After looking into this a bit more, I found out that what I said above is not 100% correct. Since WooCommerce 3.0, structured data is handled by the plugin, and not Storefront. Currently, Storefront is only outputting the json-ld format for non-WooCommerce pages. We've also started a discussion internally about the value our integration of json-ld is adding, and we came to the conclusion that there are many plugins out there that do this much better than us. For that reason, we'll be removing this functionality from the theme soon. Suggested plugins: https://wordpress.org/plugins/wordpress-seo/ |
@tiagonoronha then you should strongly consider microdata format in html5. Persons in East Europe rely on Yandex. Yandex does not accept json+ld. A plugin cannot handle microdata insertion. Only new forked copies. |
|
Just putting my chosen WP SEO tool here: Squirrly SEO is an excellent substitute/replacement for Yoast. |
Your image object needs to conform to http://schema.org/ImageObject and is missing some principle items. I would like to feature request the
caption
,thumbnail
andrepresentativeOfPage
properties be inserted / amended.The text was updated successfully, but these errors were encountered: