Skip to content

Instantly share code, notes, and snippets.

@titodevera
Created February 16, 2021 09:09
Show Gist options
  • Save titodevera/3885e090c57bdd04aeae8ff71856acef to your computer and use it in GitHub Desktop.
Save titodevera/3885e090c57bdd04aeae8ff71856acef to your computer and use it in GitHub Desktop.
Fix for Prague 2.3.0 WordPress theme bugs on Firefox
Follow this steps (DEVELOPERS ONLY!) to solve on load bugs in Firefox for the Prague WordPress theme.
1) Copy the "all.js" file from parent (/prague/assets/js/all.js) to child theme (/prague-child/all.js)
2) Add this code to your "/prague-child/functions.php"
add_action( 'wp_enqueue_scripts', function() {
wp_enqueue_script( 'prague-theme-js', get_stylesheet_directory_uri() . '/all.js', [ 'jquery' ], '6.6.6', true );
} );
3) Replace the line 97 from "/prague-child/all.js" with the code below
/* -------------------- Firefox fixes -------------------- */
var isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);
if ( isChrome ) {
onEvent('load', func, true); // window onload
} else {
jQuery(document).ready(func);
jQuery(document).ready(function($){ $('.portfolio-item-wrapp').css('float', 'left'); });
}
/* -------------------- /Firefox fixes -------------------- */
4) Say thanks for the tons of bugs in Prague theme rating it in Envato Themeforest 🤬
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment