Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static function header_output() {
- ?>
- <!--Customizer CSS-->
- <style type="text/css">
- <?php self::generate_css('#site-title a', 'color', 'header_textcolor', '#'); ?>
- <?php self::generate_css('body', 'background-color', 'background_color', '#'); ?>
- <?php self::generate_css('a', 'color', 'link_textcolor'); ?>
- </style>
- <!--/Customizer CSS-->
- <?php
- }
- public static function generate_css( $selector, $style, $mod_name, $prefix='', $postfix='', $echo=true ) {
- $return = '';
- $mod = get_theme_mod($mod_name);
- if ( ! empty( $mod ) ) {
- $return = sprintf('%s { %s:%s; }',
- $selector,
- $style,
- $prefix.$mod.$postfix
- );
- if ( $echo ) {
- echo $return;
- }
- }
- return $return;
- }
Add Comment
Please, Sign In to add comment