Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * ========================================================================
- * WP LESS EMBEDDING
- * ========================================================================
- */
- #require dirname(__FILE__) . '/framework/wp-less/bootstrap-for-theme.php';
- if ( class_exists( 'WPLessPlugin' ) and function_exists( 'ot_get_option' ) ) {
- add_action('init', 'lessc_init');
- function lessc_init() {
- $less = WPLessPlugin::getInstance();
- // set the legacy configuration
- $config = $less->getConfiguration();
- if (!WP_DEBUG)
- $config->setCompilationStrategy('legacy');
- // set some less variables
- $bg = explode ( ',', get_option_tree( 'my_background' ) ) ;
- $less->setVariables( array(
- 'primary_color' => ot_get_option( 'primary_color', '#E7492F' ),
- 'secondary_color' => ot_get_option( 'secondary_color', '#649F0B' ),
- 'bg_color' => empty($bg[0]) ? '#FAFAFA' : $bg[0],
- 'bg_image' => empty($bg[4]) ? 'url(' . get_template_directory_uri() . '/img/diamond-pattern.png)' : "url({$bg[4]})",
- 'bg_repeat' => empty($bg[1]) ? 'repeat' : $bg[1],
- 'bg_position' => empty($bg[3]) ? 'left top' : $bg[3],
- 'bg_attachment' => empty($bg[2]) ? 'scroll' : $bg[2]
- )
- );
- $less->dispatch();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment