How to offload CSS and JS files from wp-content/themes folder?

Are you using a child theme? Is get_template_directory_uri() function returning the correct URL? My suggestion is to use get_stylesheet_directory_uri() instead. wp_enqueue_style( ‘validationEngine.jquery’, get_stylesheet_directory_uri() . ‘/assets/css/validationEngine.jquery.css’, array(), false, ‘screen’ ); wp_enqueue_style( ‘main’, get_stylesheet_directory_uri() . ‘/assets/css/main.css’, array(), false, ‘screen’ );

Loading a stylesheet on a specific page [duplicate]

Try using parent and child class to use css on specific page <div class=”top-container”><span class=”header-text”> content here</span> </div> Assign a page level class .top-container{} And then assign use it as a parent class for styling rest of elements on page .top-container .header-text{} You do not need to load a separate stylesheet rather than you can … Read more

wordpress doesnt add media.css file

/css/media.min.css?ver=4.8.1 is not indicative of a “min version”. The filename of this CSS file is LITERALLY: ‘media.min.css’. (Additionally the file is versioned with the ver parameter set to 4.8.1). So atetmpting to enqueue: wp_enqueue_style(‘media’, get_template_directory_uri().’/css/media.css’); Will certainly fail, and should in fact be: wp_enqueue_style(‘media’, get_template_directory_uri().’/css/media.min.css’);

how to fix loading scripts in child theme?

You are using a child theme here, it means that you should use get_stylesheet_directory_uri() to get the child theme’s directory. So, in your case, get_stylesheet_directory_uri() will return: localhost:8888/wp-content/themes/x-child/ and get_template_directory_uri() will return: localhost:8888/wp-content/themes/x/ Use this to build your paths. Also, pay attention that you need to include a forward slash before your style/script’s name, since … Read more