Skip to content

Options

Nick Haskins edited this page Nov 24, 2013 · 12 revisions

Theory

All options are handled by Wordpress Theme Customizer. Soren has several built in option types that child themes can utilize within themes.

All colors, and font-size options are process with the live LESS compiler. Try to avoid inline styles where necessary and filter soren_less_vars to create custom LESS variables to use within your theme.

Example of Adding Custom LESS Var
add_filter( 'soren_less_vars', 'my_less_vars');  
public function my_less_vars($vars){  
  $vars[ 'my-new-color' ]   = '#777777';  
  return $vars;  
}  
//in css
color:@my-new-color;  

Setting & Getting Options

Options are run through the Settings API in wordpress, using Theme Customizer, and serialized into one array for parent theme, and one array for child theme. To create custom options for your child theme for Theme Customizer, first create a file called yourtheme-options.php , and require_once within functions.php.

See Vulcan Child Theme for a complete example of adding child theme options.

Available Custom Controls

Settings rely on controls. Soren has several built in custom controls that include;
Soren_WP_Customize_Textarea_Control

Clone this wiki locally