Twitter widget, iFrame + sticky sidebar

This article describes how to fix a dissappearing Twitter widget or iFrame in sticky sidebar. This error occurs when Twitter or any widget is using an “iFrame” to display it’s content. The solution requires editing just a few lines of JavaScript code in the Karma theme.

Solution:

  1. You’ll need to edit a JavaScript file so first connect to the site via FTP or by using a file management plugin such as: WPide
  2. Locate the file that requires editing: ../wp-content/themes/Karma/js/custom-main.js
  3. Scroll down to around line number 295…..then locate the existing code outlined below, and replace it with the new code outlined below.
  4. Save the updated file and you are all good to go!

(please note: this fix should only be applied when using a left sidebar page template)

Line 295….Replace this code:


//make em' stick
//jQuery("#sidebar").stick_in_parent({ offset_top: 15, spacer: false }); //sidebar - use this version for (iframe) widgets in left sidebar
jQuery("#sidebar").stick_in_parent({ offset_top: 15 }); //sidebar
jQuery("#sub_nav").stick_in_parent({ offset_top: 10 }); //sub navigation

 

…with this new code


//make em' stick
jQuery("#sidebar").stick_in_parent({ offset_top: 15, spacer: false }); //sidebar - use this version for (iframe) widgets in left sidebar
//jQuery("#sidebar").stick_in_parent({ offset_top: 15 }); //sidebar
jQuery("#sub_nav").stick_in_parent({ offset_top: 10 }); //sub navigation