oEmbed not displaying on non-Single pages #91

Closed
huphtur opened this Issue Apr 22, 2014 · 22 comments

Projects

None yet

3 participants

@huphtur
huphtur commented Apr 22, 2014

Specifically Twitter and Instagram please?

@raamdev
Owner
raamdev commented Apr 22, 2014

Thank you for the feature request. Could you please elaborate on this and explain specifically what it is you'd like? The theme doesn't currently include oEmbed support at all because that's normally the job of a plugin. (The WordPress SEO by Yoast plugin does this well.) Sorry, I misunderstood this request. Please see my next comment below.

@raamdev
Owner
raamdev commented Apr 22, 2014

Actually, WordPress itself supports oEmbed:

https://codex.wordpress.org/Embeds

@huphtur
huphtur commented Apr 23, 2014

Twenty Thirteen theme:
2013

Independent Publisher theme:
idp

Hope this helps explain things a bit better.

@raamdev
Owner
raamdev commented Apr 23, 2014

Interesting! I did not realize those were broken. Thanks so much for reporting this. I'll get this fixed in the next release.

@raamdev
Owner
raamdev commented Apr 23, 2014

@huphtur I just tested this and it seems to be working for me in Independent Publisher:

Post content:

https://twitter.com/Astro_Wakata/status/457884743820787712

Result:

screen shot 2014-04-22 at 10 16 52 pm

Have you tried clearing your browser cache? Also, if you have any caching plugins installed, have you tried clearing those?

Can you try a YouTube link to see if that works? I've seen others using YouTube oEmbeds just fine as well.

Do you have the latest version of the theme (v1.4.1)?

@huphtur
huphtur commented Apr 23, 2014

Tried on multiple browsers and platforms.

Twitter embed only shows up fine in single post page: http://huphtur.nl/2013/09/05/one-of-my-first-tweets/ But not anywhere else (index/archive/search/etc).

YouTube works great. Instagram does not.

Running a clean v1.4.1 install. No adjustments made to the theme. Only Akismet installed as plugin.

@raamdev
Owner
raamdev commented Apr 23, 2014

Ah, I had not tested archive views for anything except YouTube. I will do that today and report back.

@raamdev
Owner
raamdev commented Apr 23, 2014

@huphtur I'm still unable to reproduce this. I tried Twitter oEmbed in Category archives and on the home page, and it works just fine for me. I'm running WP 3.9.1 with the latest version of Independent Publisher (v1.4.1).

I looked at the source code on your site and compared it to mine and it looks like something is stripping out the script that loads the embed widget.

Here's the Twitter code on my site:

<blockquote class="twitter-tweet" width="550"><p>Space-X Dragon spacecraft arrived on the ISS.  Congratulations to the entire team on the successful operation. <a href="http://t.co/Io7YeDCUj6">pic.twitter.com/Io7YeDCUj6</a></p>
<p>&mdash; Koichi Wakata (@Astro_Wakata) <a href="https://twitter.com/Astro_Wakata/statuses/457884743820787712">April 20, 2014</a></p></blockquote>
<p><script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script></p>

And here it is on yours (notice the empty paragraph tag at the end?):

<blockquote class="twitter-tweet" width="550"><p>Nutella on sale: 2 for 2.50!</p>
<p>&mdash; huphtur (@huphtur) March 25, 2007</p></blockquote>
<p></p>

I would suspect a plugin or a server-side issue, but you showed that it's working in Twenty Thirteen, so I'm really puzzled...

@raamdev
Owner
raamdev commented Apr 23, 2014

Ah, I have a theory.

Could you please try wrapping the oEmbed URL in [embed][/embed] tags?

[embed]https://twitter.com/Astro_Wakata/status/457884743820787712[/embed]

Does that make it work?

@huphtur
huphtur commented Apr 23, 2014

Wrapping in [embed] has no results.

I noticed the Format was set to "Aside" when I switch to Standard post, it works.

@raamdev
Owner
raamdev commented Apr 23, 2014

I just saw that you were using the Aside post format when I was looking at your code.

And I found the bug.

I'll push out a fix in the next release. For now, I recommend using the Standard post format, or you can manually patch your theme. (I'll update this issue shortly when I've pushed the patch for you to see.)

@rad96
Contributor
rad96 commented Apr 23, 2014

hm, on my blog it working :)
download

@raamdev
Owner
raamdev commented Apr 23, 2014

@rad96 This is only an issue if you use the "Aside" or "Quote" Post Format and then try to view the oEmbed from your home page or an archive page (such as the Category archives). It works just fine on the Single post page.

@huphtur I've submitted a patch (0f77576) for this and this fix will go out with the next theme update (soon). If you want to manually patch functions.php as shown in the commit (0f77576), feel free to do that. If you could confirm this fix works for you, I'd greatly appreciate it!

Details about what was changed in 0f77576 and why

I was previously stripping all HTML tags (except a few allowed tags) when displaying posts with the Aside or Quote format in non-Single views (e.g.,, Category or Home Page views). This was done to help ensure that the formatting of the Aside or Quote remained consistent.

However, I now feel that's the wrong approach.

I didn't expect anyone to post a Twitter oEmbed in an Aside Post Format, but why shouldn't they be able to? In fact, why should I enforce anything here?

So, commit 0f77576 removes the strip_tags() function. The only thing that gets stripped from Aside and Quote formats now are Footnotes, which wouldn't work on any view except the Single post view anyway.

@raamdev raamdev changed the title from Feature Request: Better oEmbed Support. to oEmbed not displaying on non-Single pages Apr 23, 2014
@raamdev raamdev added this to the Next release milestone Apr 23, 2014
@huphtur
huphtur commented Apr 23, 2014

Thanks Raam. I can wait for official update.

What about Instagram oEmbed?

@raamdev
Owner
raamdev commented Apr 23, 2014

@huphtur I just tested Instagram by pasting the following in a post:

http://instagram.com/p/nBfvvYmDnL

And as expected the Instagram image shows up:

screen shot 2014-04-23 at 2 28 33 pm

@raamdev
Owner
raamdev commented Apr 23, 2014

And as expected the Instagram image shows up:

It also shows up on Category an Home Page views.

@huphtur
huphtur commented Apr 23, 2014

Nothing shows up for me:

embed test huphtur 2014-04-23 11-37-09 2014-04-23 11-37-14

@raamdev
Owner
raamdev commented Apr 23, 2014

Can you give me a link to look at the source?

@raamdev
Owner
raamdev commented Apr 23, 2014

@huphtur This appears to be a bug in WordPress, as Instagram embeds don't work on the default Twenty Thirteen theme when the post format is Aside. I'm doing some more research and will report back with my findings.

@raamdev
Owner
raamdev commented Apr 23, 2014

@huphtur Yup, this appears to be either a WordPress issue or an issue with the Instagram API (maybe it's overloaded and the WordPress oEmbed request to Instagram's severs isn't going through?)

As you can see from my screenshot above, it worked for me. But when I just tried it again, it's not working. That tells me it has something to do with Instagram's servers.

You might want to try posting a support query on the WordPress.org Support Forums to see if they can offer any insight.

I'm going to close this issue for now, but if you find any other bugs please let me know. Thank you again for working with me on this!

@raamdev raamdev closed this Apr 23, 2014
@huphtur
huphtur commented Apr 23, 2014

No problem @raamdev. Thanks for the assist. Awaiting new version so at least my tweets show up correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment