Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Embedded Facebook status not calculated so masonry grid doesn't load correctly

Status
Not open for further replies.

esper

Programmer
Jan 17, 2006
1
0
0
TH
I'm using the X theme on Wordpress which allows me to display my blog page in a two-column masonry-style layout. Blog posts can be different types, one of which is 'status'. I am embedding a Facebook status but the problem is that the height is not defined so when the page loads, the height of the Facebook status is not calculated before the rest of the page loads, so the next blog post underneath lays half way over the Facebook status blog post.

Two examples from the blog page:

fb1.jpg


fb2.jpg


If you go to the page for the first time the chances are the Facebook status will be overlapped. If you then reduce the browser window and then maximise it, the correct Facebook height is calculated, but this is not a solution of course.

It's the standard div from Facebook pasted into the excerpt (makes no difference if pasted into the content area).

Code:
<div class="fb-post" data-href="[URL unfurl="true"]https://www.facebook.com/followtheboat/photos/a.441724739204342.94818.140796312630521/972409826135828/?type=3"[/URL] data-width="500"></div>

Of course this falls outside the support of the X theme because this is a Facebook javascript issue but they did suggest:

X developer said:
I think you can use the Facebook API to call a function right after it’s loaded and it should call $(window).trigger('resize');

... but that's beyond my ken. Any clues?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top