Skip to content

Loading CSS Styles

Brian McCoy edited this page Feb 23, 2018 · 4 revisions

Adding Styles

  • Store your CSS files under assets/styles in your theme.

Loading Styles

  • Inside your theme open /app/assets/css-assets.php
  • Add a load_css() call. The first parameter is the URL to the CSS file. The second optional parameter is an array of arguments. See arguments.
  • If handle is not defined as an arg the URL parameter will be used.
  • If ver is not defined as an arg the theme version will be used.

Examples

If you simply need to load a CSS file you can do:

load_css( _templateURL . '/assets/styles/application.css' );

Let's say you need to define the "handle" and "version" parameters. You'd simply define the arguments parameter:

load_css( _templateURL . '/assets/styles/application.css', [
	'handle' => 'foo',
	'ver' => '2.0'
] );

Clone this wiki locally