28330 comments found.
Instagram has returned invalid data. What’s going on and how to fix this?
Try updated to latest version using the auto update. This was just fixed 
Instagram has returned invalid data. Looks like everybody’s having this problem.
Try updated to latest version using the auto update. This was just fixed 
Just chiming in here to say our site is also showing the “Instagram has returned invalid data.” error for the embedded instagram feed.
Try updated to latest version using the auto update. This was just fixed 
Also having an Instagram error “Instagram has returned invalid data.” please help me…Thank You
Try updated to latest version using the auto update. This was just fixed 
Hey there – is it possible to have the thumbnails for portfolios be 16:9 instead of square? I understand this may involve some messing with the page templates – where would I start?
nevermind – just saw this is an option when setting up the portfolio. Awesome!
Same here. Getting “Instagram has returned invalid data” error
Also having an Instagram error “Instagram has returned invalid data.”
Try updated to latest version using the auto update. This was just fixed 
Also having an Instagram error “Instagram has returned invalid data.”
Hey Does this theme come with Visual Composer? Front -end and Back-end Both?
Also having an Instagram error “Instagram has returned invalid data.”
Suddenly this message appeared: : Instagram has returned invalid data. and Instagram feed it doesn’t work
Hi! I am using the transparent header layout. It doesn´t work to set the slider to have dark theme nav while the background remain light theme? After last Theme update I´ve had several problems on my site. Demo-text pops up different places, product-images looks kind of messy. Can this be fixed? When will a new version be released?
First it is a nice theme but i have some doubts,
In this template : http://flatsome3.uxthemes.com/shop/booking/weekend-in-san-fransico/?style=layout-explore
When i put add to car he go to another page, why? i don’t want that i want when the user press the button just add the product to the car.
And another thing do you guys have some page builder for custom post types? not just woocommerce?
because i will use a lot and have a plugin called event calendar that use that!
Is it possible to have a floating box or sidebar using this theme? Something which follows on scroll..?
How i can get track-order page?
Is there a way to make an animation repeat (infinite)? For example a Fade In Down on an image.
What is the response time when mailing the support email? I emailed 2 days ago but still no response….
No?
Hi there, Did you use the “Support” tab on this site? https://themeforest.net/item/flatsome-multipurpose-responsive-woocommerce-theme/5484319/support
This support helpscout tab – to what email is it connected? support@uxthemes.com?
Re “Instagram has returned invalid data”. Try this alternative code (definitely works for me). Just replace the entire flatsome_scrape_instagram function in flatsome/inc/shortcodes/ux_instagram_feed.php with this:
function flatsome_scrape_instagram( $username ) {
$username = trim( strtolower( $username ) );
switch ( substr( $username, 0, 1 ) ) {
case '#':
$url = 'https://instagram.com/explore/tags/' . str_replace( '#', '', $username );
$transient_prefix = 'h';
break;
default:
$url = 'https://instagram.com/' . str_replace( '@', '', $username );
$transient_prefix = 'u';
break;
}
if ( false === ( $instagram = get_transient( 'insta-a10-' . $transient_prefix . '-' . sanitize_title_with_dashes( $username ) ) ) ) {
$remote = wp_remote_get( $url );
if ( is_wp_error( $remote ) ) {
return new WP_Error( 'site_down', esc_html__( 'Unable to communicate with Instagram.', 'wp-instagram-widget' ) );
}
if ( 200 !== wp_remote_retrieve_response_code( $remote ) ) {
return new WP_Error( 'invalid_response', esc_html__( 'Instagram did not return a 200.', 'wp-instagram-widget' ) );
}
$shards = explode( 'window._sharedData = ', $remote['body'] );
$insta_json = explode( ';</script>', $shards[1] );
$insta_array = json_decode( $insta_json[0], true );
if ( ! $insta_array ) {
return new WP_Error( 'bad_json', esc_html__( 'Instagram has returned invalid data.', 'wp-instagram-widget' ) );
}
if ( isset( $insta_array['entry_data']['ProfilePage'][0]['graphql']['user']['edge_owner_to_timeline_media']['edges'] ) ) {
$images = $insta_array['entry_data']['ProfilePage'][0]['graphql']['user']['edge_owner_to_timeline_media']['edges'];
} elseif ( isset( $insta_array['entry_data']['TagPage'][0]['graphql']['hashtag']['edge_hashtag_to_media']['edges'] ) ) {
$images = $insta_array['entry_data']['TagPage'][0]['graphql']['hashtag']['edge_hashtag_to_media']['edges'];
} else {
return new WP_Error( 'bad_json_2', esc_html__( 'Instagram has returned invalid data.', 'wp-instagram-widget' ) );
}
if ( ! is_array( $images ) ) {
return new WP_Error( 'bad_array', esc_html__( 'Instagram has returned invalid data.', 'wp-instagram-widget' ) );
}
$instagram = array();
foreach ( $images as $image ) {
if ( true === $image['node']['is_video'] ) {
$type = 'video';
} else {
$type = 'image';
}
$caption = __( 'Instagram Image', 'wp-instagram-widget' );
if ( ! empty( $image['node']['edge_media_to_caption']['edges'][0]['node']['text'] ) ) {
$caption = wp_kses( $image['node']['edge_media_to_caption']['edges'][0]['node']['text'], array() );
}
$instagram[] = array(
'description' => $caption,
'link' => trailingslashit( '//instagram.com/p/' . $image['node']['shortcode'] ),
'time' => $image['node']['taken_at_timestamp'],
'comments' => $image['node']['edge_media_to_comment']['count'],
'likes' => $image['node']['edge_liked_by']['count'],
'thumbnail' => preg_replace( '/^https?\:/i', '', $image['node']['thumbnail_resources'][0]['src'] ),
'small' => preg_replace( '/^https?\:/i', '', $image['node']['thumbnail_resources'][2]['src'] ),
'large' => preg_replace( '/^https?\:/i', '', $image['node']['thumbnail_resources'][4]['src'] ),
'original' => preg_replace( '/^https?\:/i', '', $image['node']['display_url'] ),
'type' => $type,
);
} // End foreach().
// do not set an empty transient - should help catch private or empty accounts.
if ( ! empty( $instagram ) ) {
$instagram = base64_encode( serialize( $instagram ) );
set_transient( 'insta-a10-' . $transient_prefix . '-' . sanitize_title_with_dashes( $username ), $instagram, apply_filters( 'null_instagram_cache_time', HOUR_IN_SECONDS * 2 ) );
}
}
if ( ! empty( $instagram ) ) {
return unserialize( base64_decode( $instagram ) );
} else {
return new WP_Error( 'no_images', esc_html__( 'Instagram did not return any images.', 'wp-instagram-widget' ) );
}
}
For people getting tired of waiting for an update and reaction of Flatsome Team here is a fix i have just finished to test, that is working 100%
Find the new WP error badjson2 line beginning by: “if ( isset….”
And replace by all of this code bellow till the end of foreach image section:
if ( isset( $insta_array['entry_data']['ProfilePage'][0]['user']['media']['nodes'] ) ) {
$images = $insta_array['entry_data']['ProfilePage'][0]['user']['media']['nodes'];
} elseif ( isset( $insta_array['entry_data']['TagPage'][0]['graphql']['hashtag']['edge_hashtag_to_media']['edges'] ) ) {
$images = $insta_array['entry_data']['TagPage'][0]['graphql']['hashtag']['edge_hashtag_to_media']['edges'];
} elseif ( isset( $insta_array['entry_data']['ProfilePage'][0]['graphql']['user']['edge_owner_to_timeline_media']['edges'] ) ) {
$images = $insta_array['entry_data']['ProfilePage'][0]['graphql']['user']['edge_owner_to_timeline_media']['edges'];
}
else {
return new WP_Error( 'bad_json_2', esc_html__( 'Instagram has returned invalid data.', 'flatsome-admin' ) );
}
if ( ! is_array( $images ) ) {
return new WP_Error( 'bad_array', esc_html__( 'Instagram has returned invalid data.', 'flatsome-admin' ) );
}
$instagram = array();
foreach ( $images as $image ) {
if ( true === $image['node']['is_video'] ) {
$type = 'video';
} else {
$type = 'image';
}
$caption = __( 'Instagram Image', 'wp-instagram-widget' );
if ( ! empty( $image['node']['edge_media_to_caption']['edges'][0]['node']['text'] ) ) {
$caption = $image['node']['edge_media_to_caption']['edges'][0]['node']['text'];
}
$instagram[] = array(
'description' => $caption,
'link' => trailingslashit( '//instagram.com/p/' . $image['node']['shortcode'] ),
'time' => $image['node']['taken_at_timestamp'],
'comments' => $image['node']['edge_media_to_comment']['count'],
'likes' => $image['node']['edge_liked_by']['count'],
'thumbnail' => preg_replace( '/^https?\:/i', '', $image['node']['thumbnail_resources'][0]['src'] ),
'small' => preg_replace( '/^https?\:/i', '', $image['node']['thumbnail_resources'][2]['src'] ),
'large' => preg_replace( '/^https?\:/i', '', $image['node']['thumbnail_resources'][4]['src'] ),
'original' => preg_replace( '/^https?\:/i', '', $image['node']['display_url'] ),
'type' => $type,
);
}
Enjoy 
Come on guys the Instagram API changes were announced in late January. Switching to Graph API was not a suprise….
They said developpers should be prepared and that they also should implement an automatic update function to their plugin as this new Graph API will cause frequent changes of Instagram connected services.
This is not acceptable for people using your theme as BUSINESS theme to get their homepage broken for days each time Instagram will change something !
The team reactivity/support is becoming lower and slower these late monthes….
P.S: @nuffstuff code is not working here too
Majority of good instagram plugins were back on track in some hours 