Guest User

Untitled

a guest
Jul 22nd, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. public static function header_output() {
  2. ?>
  3. <!--Customizer CSS-->
  4. <style type="text/css">
  5. <?php self::generate_css('#site-title a', 'color', 'header_textcolor', '#'); ?>
  6. <?php self::generate_css('body', 'background-color', 'background_color', '#'); ?>
  7. <?php self::generate_css('a', 'color', 'link_textcolor'); ?>
  8. </style>
  9. <!--/Customizer CSS-->
  10. <?php
  11. }
  12.  
  13. public static function generate_css( $selector, $style, $mod_name, $prefix='', $postfix='', $echo=true ) {
  14. $return = '';
  15. $mod = get_theme_mod($mod_name);
  16. if ( ! empty( $mod ) ) {
  17. $return = sprintf('%s { %s:%s; }',
  18. $selector,
  19. $style,
  20. $prefix.$mod.$postfix
  21. );
  22. if ( $echo ) {
  23. echo $return;
  24. }
  25. }
  26. return $return;
  27. }
Add Comment
Please, Sign In to add comment