Last active
August 29, 2015 13:59
-
-
Save BoweFrankema/10998747 to your computer and use it in GitHub Desktop.
Titan Framework and LESS Variables
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Pass variables from Titan Option to WP-LESS. This seems tricky. | |
*/ | |
function cf_theme_variables() | |
{ | |
if (class_exists('WPLessPlugin')){ | |
$titan = TitanFramework::getInstance( 'cfcommunity-roots' ); | |
$less = WPLessPlugin::getInstance(); | |
$primary_brand = $titan->getOption( 'my_text_option' ); | |
$less->addVariable('custom-brand-primary', $primary_brand); | |
// you can now use @myColor in your *.less files | |
// you can now use @minSize in your *.less files | |
// @myColor value has been updated to #777 | |
} | |
} | |
add_action( 'plugins_loaded', 'cf_theme_variables' ); | |
?> | |
Current error: | |
Fatal error: Uncaught exception 'Less_Exception_Compiler' | |
with message 'variable @custom-brand-primary is undefined' in | |
lib/vendor/wp-less/lib/vendor/less.php/lib/Less/Tree/Variable.php:48 S |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment