Using etheme.js instead of etheme.min.js?

This topic has 4 replies, 2 voices, and was last updated 5 years, 1 months ago ago by Olga Barlow

  • Avatar: AWarmFastBear
    Ian S
    Participant
    February 28, 2019 at 06:21

    Hi,

    In order to do some additional bug fixing and feature development for the Xstore I am wondering if it’s possible to switch over to having the Xstore theme use the etheme.js file instead of the minified one, is this possible?

    I’m already using the Xstore child theme. If I try and flip over to the etheme.js file using the theme-init.php by changing etheme.min.js to etheme.js then the site is partially working. Is there a development version of the etheme.js file I can use?

    I’m trying to make fixes for these posts that you told me I need to custom code:
    https://www.8theme.com/topic/adding-products-secondary-menu-to-main-menu-to-see-when-scrolling/
    https://www.8theme.com/topic/searching-for-product-categories-with-the-search-box/

    Thank you.

    3 Answers
    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    February 28, 2019 at 16:59

    Hello,

    etheme.min.js file includes not only etheme.js but the compilation of some other scripts in the appropriate order (‘js/jquery.magnific-popup.js’, ‘js/waypoints.min.js’, ‘js/swiper.js’, ‘js/cookie.js’, ‘js/jquery.sticky-kit.js’, ‘js/etheme.js’ ) that’s why site works partially if you use etheme.js only. We sent you all these files to your registration email, you can check and merge them.

    Also, keep in mind that you can use custom scripts in the child theme (for example create file xstore-child/js/custom.js and add to the child theme functions.php code

    function etheme_enqueue_scripts_custom() {
    	wp_enqueue_script('etheme-child', get_stylesheet_directory_uri().'/js/custom.js',array(),false,true);
    }
    add_action( 'wp_enqueue_scripts', 'etheme_enqueue_scripts_custom');

    )

    Regards

    Avatar: AWarmFastBear
    Ian S
    Participant
    March 1, 2019 at 06:16

    Hi,

    Thank you for sending me those files, I’m some what confused, I modified the child theme-functions.php script and I had to combine all of the scripts into a single js file to get the site to load correctly. I wasn’t able to queue them up with the first block of code below, the site partially loads without errors. Any idea why I can’t load each file independently for testing?

    The scripts are definitely in the xstore-child/js/ directory as my code further below works.

    function etheme_enqueue_scripts_custom() {
    	wp_enqueue_script('etheme-child', get_stylesheet_directory_uri().'/js/jquery.magnific-popup.js',$script_depends,false,true);
    	wp_enqueue_script('etheme-child', get_stylesheet_directory_uri().'/js/waypoints.min.js',$script_depends,false,true);
    	wp_enqueue_script('etheme-child', get_stylesheet_directory_uri().'/js/swiper.js',$script_depends,false,true);
    	wp_enqueue_script('etheme-child', get_stylesheet_directory_uri().'/js/cookie.js',$script_depends,false,true);
    	wp_enqueue_script('etheme-child', get_stylesheet_directory_uri().'/js/jquery.sticky-kit.js',$script_depends,false,true);
    	wp_enqueue_script('etheme-child', get_stylesheet_directory_uri().'/js/etheme.js',$script_depends,false,true);
    }
    add_action( 'wp_enqueue_scripts', 'etheme_enqueue_scripts_custom');
    

    If I just use the code below and have all of the scripts in the custom.js file using your load order the site loads as expected:

    function etheme_enqueue_scripts_custom() {
    	wp_enqueue_script('etheme-child', get_stylesheet_directory_uri().'/js/custom.js',array(),false,true);
    }
    add_action( 'wp_enqueue_scripts', 'etheme_enqueue_scripts_custom');

    Strange.

    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    March 1, 2019 at 10:37

    Hello,

    You can’t use them independently because our theme use etheme.min.js by default and etheme.min.js file already includes all the files above and you get conflict.

    Regards

  • Viewing 4 results - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.