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

I need to ‘wp_dequeue_script’ and ‘styles’ and ADD a bunch of other css and js

Using wp_enqueue_scripts You should use a proper hook to enqueue/dequeue your scripts, to ensure that it works flawlessly. A proper plugin/theme uses wp_enqueue_scripts to do this, so you should do the same. Wrap your code inside a function, and bind it to this action hook. Also, remember to set the priority to something that makes … Read more

How do I dequeue a Stylesheet, stored in an ‘Assets’ folder?

Two things you need to: Hook into wp_enqueue_scripts with a priority later than the parent theme’s. The default is 10 so that’s a good assumption. If 11 doesn’t work, check the parent theme’s source to see which priority it’s hooked at. Use wp_dequeue_style() to do the dequeueing. That will look like: function wpse_293836_dequeue_parent_styles(){ wp_dequeue_style( ‘theme-skin-color’ … Read more