Skip to content
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

Closed
inetbiz opened this issue Jul 6, 2017 · 12 comments
Closed

storefront functions [json+ld] #620

inetbiz opened this issue Jul 6, 2017 · 12 comments
Labels
type: enhancement The issue is a request for an enhancement.

Comments

@inetbiz
Copy link

inetbiz commented Jul 6, 2017

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 and representativeOfPage properties be inserted / amended.

@inetbiz
Copy link
Author

inetbiz commented Jul 6, 2017

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 $attr for image description. I think that should be used for http://schema.org/caption

@tiagonoronha tiagonoronha added the type: enhancement The issue is a request for an enhancement. label Jul 6, 2017
@tiagonoronha
Copy link
Contributor

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 representativeOfPage is not that simple. Not all images are representative of the page.

I'll into this asap.

@inetbiz
Copy link
Author

inetbiz commented Jul 6, 2017

@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.

@inetbiz
Copy link
Author

inetbiz commented Jul 6, 2017

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 primaryImageOfPage would be the category thumbnail's full image size. Keep that large for social networks that read json+ld to scrape the content for rendering the share.

@inetbiz
Copy link
Author

inetbiz commented Jul 6, 2017

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.

@inetbiz
Copy link
Author

inetbiz commented Jul 6, 2017

@jvandriel
Copy link

"Also this is how a category page should be written up. https://json-ld.org/playground/#/gist/c735f8a1c4f14523227e4064bfb61acb"

I'd not use the above mentioned template for category pages but https://output.jsbin.com/vucuvex instead.

@inetbiz
Copy link
Author

inetbiz commented Jul 6, 2017

@jvandriel I think it's the exact same. But, using json playground. jsbin seemed to be running rather sluggish for me?

@tiagonoronha
Copy link
Contributor

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/
https://wordpress.org/support/plugin/wp-structuring-markup

@inetbiz
Copy link
Author

inetbiz commented Jul 7, 2017

@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.

@tiagonoronha
Copy link
Contributor

The following syntaxes are currently supported: JSON-LD, RDFa, microdata, and microformats.

https://tech.yandex.com/validator/

@JamesJosephFinn
Copy link

Just putting my chosen WP SEO tool here: Squirrly SEO is an excellent substitute/replacement for Yoast.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement The issue is a request for an enhancement.
Projects
None yet
Development

No branches or pull requests

4 participants