Skip to content
This repository has been archived by the owner on Apr 21, 2021. It is now read-only.

og:tags (header) #42

Open
jan-dh opened this issue Nov 3, 2015 · 6 comments
Open

og:tags (header) #42

jan-dh opened this issue Nov 3, 2015 · 6 comments

Comments

@jan-dh
Copy link

jan-dh commented Nov 3, 2015

I was wondering If you would (out of the box) have a some og:tags support in the header. I have a solution that I'm using now that checks:

  • is the current page a single-post template: give me specific post og:data
  • is it something else: give me the page specific og:data.

I was planning on posting the code here but it's a lot, I'll do it as a pull-request in the header.

@joseluis
Copy link
Member

joseluis commented Nov 3, 2015

When it's a lot of code I usually prefer to share it first via jsfiddle / codepen or something like that.

I see you already sent it #43. It's ok but even if we end up using it or a variation of it, that code won't live in the header but in an appropriate file under /theme/lib/ and will be called as a function.

I was planning to use some semi-automatic solution for microdata and/or schema.org too. Possibly related: #9

@jan-dh
Copy link
Author

jan-dh commented Nov 3, 2015

I'll see what I can do with the fiddles in the future 😄 The solution I posted is more focused on being able to share posts/pages easely on facebook. (by including an image, excerpt,...)

@joseluis
Copy link
Member

joseluis commented Nov 3, 2015

I see. It's a good start. I like the idea, but it will need more work in order to integrate with the rest of the system.

For example I'd like to make og:type more versatile, to support custom post types easily. The same with og:image.

I'm thinking maybe creating a main function that accepts many or all og metadata as parameters, and several handy wrappers for the most common situations / templates.

Resources:

@jan-dh
Copy link
Author

jan-dh commented Nov 3, 2015

Things like image etc. are pretty basic. When you use the facebook-debugger tool you'll see what facebook needs to show your posts. You could also add author and some time-stamp. When I post a link from a single article from the site I used the header for it comes up like this:

image

Regarding the og:type, article and website are the two most relevant types available. So on a single post changing it to type and the rest to website seems pretty standard. People will always be able to overwrite things if they don't like it, but it provides a nice out-of-the-box result.

@joseluis
Copy link
Member

joseluis commented Nov 3, 2015

Ok, that link is a good resource.

I'll include this feature for sure, but I have to think about the proper way to do it. The good thing is that we have all the info we need already.

@joseluis
Copy link
Member

joseluis commented Nov 7, 2015

I've confirmed with the WP themereview team that open graph is plugin territory. So I'll put it inside the companion plugin.

Related: #45

@joseluis joseluis added the PLUGIN label Nov 7, 2015
@joseluis joseluis added this to the medula 0.6 milestone Nov 15, 2015
@joseluis joseluis removed the PLUGIN label Nov 16, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants