![]() ![]() In that case, the recommended way to do this in Wordpress is to use the. Enqueue multiple CSS files or Style file in WordPress Theme To enqueue multiple CSS files, you can keep them within a function and enqueue them by WordPress hook. Learn how to enqueue scripts and styles (assets) in WordPress to ensure your. I assume it needs to be loaded last because it depends on other stylesheets files. For more detailed explanation on how to include the style.css file in a theme, see the Stylesheets section of Enqueuing Scripts and Styles. Remember: Don’t forget to change the name & path of the css file. I added the codes (below) into the header.php. In order for WordPress to recognize the set of theme template files as a valid theme, the style.css file needs to be located in the root directory of your theme, not a subdirectory. This is my folder structure with only admin side (no block): my-pluginĪdminIndex.js file looks like this: import from App from './components/App/App' Īnd this is what plugin. To enqueue CSS or style file in WordPress theme, add the below code in your theme’s functions.php file. ![]() ![]() But then when I registered a block, the admin page is showing up but no React component which only include an input field. In other words, WordPress should load the CSS styles found in /wp-content/themes/twentyseventeen/style.css. The gettemplatedirectoryuri () part specifies where style.css is located: it’s in the main folder of the parent theme. I first started with creating the admin side with React and it was working perfectly fine as I followed this WordPress’s tutorial here. Specifically, it tells WordPress to use the stylesheet called style.css. I am trying to create a basic plugin that will create both admin dashboard page as well as a Gutenberg block. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |