{"id":12304578,"date":"2020-01-08T14:10:01","date_gmt":"2020-01-08T14:10:01","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/correct-use-of-wp_enqueue\/"},"modified":"2020-01-08T15:26:27","modified_gmt":"2020-01-08T15:26:27","slug":"correct-use-of-wp_enqueue","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/correct-use-of-wp_enqueue\/","title":{"rendered":"Correct use of wp_enqueue"},"content":{"rendered":"<p>Hi<\/p>\n<p>I use a plugin called EventON (and I have been in extensive touch with their devs on how to do this), and I have made a custom stylesheet because I don&#8217;t like their styling. In my functions.php file, I have dequeued the plugin styles (3 of them) and enqueued a new stylesheet in my Child Theme&#8217;s directory. According the plugin devs, my dequeueing is fine.<\/p>\n<p>I enqueue my custom stylesheet thus:<\/p>\n<pre><code>function enqueue_custom_styles() {\nwp_enqueue_style(&#039;eventon-custom-styles&#039;, get_template_directory_uri() . &quot;\/eventON_custom.css&quot;  . &#039;\t&#039;, array(), &#039;&#039;, &#039;all&#039;);\n}\n\nadd_action(  &#039;wp_enqueue_style&#039;, &#039;enqueue_custom_styles&#039;  );<\/code><\/pre>\n<p>Should I perhaps add something that forces it to load after the other styles queued in my functions.php?<\/p>\n<p>Thanks in advance!<br \/>\nSwissP<\/p>\n<p>PS You can see that the page has not loaded at all. It was loading perfectly perfectly before these queuing changes.<\/p>\n","protected":false},"template":"","class_list":["post-12304578","topic","type-topic","status-publish","hentry","topic-tag-wp_enqueue"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/12304578","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":2,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/12304578\/revisions"}],"predecessor-version":[{"id":12304723,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/12304578\/revisions\/12304723"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=12304578"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}