jbrinley / WP-Router

Routes paths to callback functions in WordPress
108 stars 27 forks source link

How to use custom css files with pages shown through the new routes ? #20

Open maxcode360 opened 7 years ago

maxcode360 commented 7 years ago

Hi, This may be a very simple thing to do but can't figure it out.

Q- How does one go about including css files on the page accessible through a route setup via WP-Router ? Note: The page is being set up via a new plugin I am trying to make. Note2: linking to a CDN is an option but figuring out what to do if I want my plugin to be self-contained

Do we - A) Use the action 'wp_enqueue_scripts' or B) Serve the file from another route(like '/assets/css/mycss') setup using WP-Router using 'file_get_contents' ? C) Something else.

Let me know if this can be done with this plugin? Thanks !