Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #26463

    How to remove the get parameters from JS/CSS files (e.g. enfold.css?ver=1)

    #130503

    Hi,

    Open functions.php, look for these codes

    wp_register_script( 'avia-compat', $template_url.'/js/avia-compat.js', array('jquery'), 1, false ); //needs to be loaded at the top to prevent bugs
    wp_register_script( 'avia-default', $template_url.'/js/avia.js', array('jquery'), 1, true );
    wp_register_script( 'avia-shortcodes', $template_url.'/js/shortcodes.js', array('jquery'), 1, true );
    wp_register_script( 'avia-prettyPhoto', $template_url.'/js/prettyPhoto/js/jquery.prettyPhoto.js', 'jquery', "3.1.5", true);
    wp_register_script( 'avia-html5-video', $template_url.'/js/mediaelement/mediaelement-and-player.min.js', 'jquery', "1", true);

    and these codes

    wp_register_style( 'avia-style' ,  $child_theme_url."/style.css", array(), '1', 'screen' ); //register default style.css file. only include in childthemes. has no purpose in main theme
    wp_register_style( 'avia-grid' , $template_url."/css/grid.css", array(), '1', 'screen' );
    wp_register_style( 'avia-base' , $template_url."/css/base.css", array(), '1', 'screen' );
    wp_register_style( 'avia-layout', $template_url."/css/layout.css", array(), '1', 'screen' );
    wp_register_style( 'avia-scs', $template_url."/css/shortcodes.css", array(), '1', 'screen' );
    wp_register_style( 'avia-custom', $template_url."/css/custom.css", array(), '1', 'screen' );
    wp_register_style( 'avia-prettyP', $template_url."/js/prettyPhoto/css/prettyPhoto.css", array(), '1', 'screen' );
    wp_register_style( 'avia-media' , $template_url."/js/mediaelement/skin-1/mediaelementplayer.css", array(), '1', 'screen' );
    wp_register_style( 'jquery-ui-datepicker', apply_filters('avf_datepicker_skin', 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/themes/smoothness/jquery-ui.css'), array(), '1', 'screen');

    Remove the version number, for example:

    wp_register_style( 'avia-grid' , $template_url."/css/grid.css", array(), '1', 'screen' );

    should be replace with

    wp_register_style( 'avia-grid' , $template_url."/css/grid.css", array(), $ver, 'screen' );

    $ver will default to false. Refer to this link: http://codex.wordpress.org/Function_Reference/wp_register_style & http://codex.wordpress.org/Function_Reference/wp_register_script

    Regards,

    Ismael

Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘How to remove the get parameters from JS/CSS files (e.g. enfold.css?ver=1)’ is closed to new replies.