wflux_css_theme_path

Description

Allows your main child theme style.css file path to be filtered when your website <head> section is rendered. Can be used either conditionally or globally.

This does not alter admin/core WordPress use of your child theme style.css – it only filters what get’s loaded when the site loads.

Default value

WF_THEME_URL.'/style.css'

Accepted values

Text string: Full url type path to stylesheet, for example:
http://mycdnsite.com/wp-content/themes/my_theme/style_2.css

or

<?php $p = WF_THEME_URL.'/style-alternative.css'; ?>

Example

<?php
//Example 1
//In your child theme functions.php file:
function my_wfx_example_function() {
  return WF_THEME_URL.'/style-alternative.css';
}
add_filter('wflux_css_theme_path','my_wfx_example_function');

// Example 2
//Conditional example in your child theme functions.php file:
// Only run filter if view is page
function my_wfx_example_function_2() {
  if ( is_page() ) :
    add_filter('wflux_css_theme_path','my_wfx_example_function');
  endif;
}
add_action('template_redirect','my_wfx_example_function_2', 1);
 ?>

Notes

Use the Wonderflux core constant WF_THEME to ensure you always get the correct URL path to your Wonderflux child theme directory as shown in the example above.

This is for more advanced developers – most users would be best loading an additional CSS file usingwp_register_style() and wp_enqueue_style().

This filter documentation was last modified on: September 6, 2012 by Jonny