wpcom.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. /**
  3. * Scripts specific for wordpress.com
  4. *
  5. * @package Rebalance
  6. */
  7. function rebalance_wpcom_setup() {
  8. global $themecolors;
  9. /**
  10. * Set a default theme color array for WP.com.
  11. *
  12. * @global array $themecolors
  13. * @since Underscores.me 1.0
  14. */
  15. $themecolors = array(
  16. 'bg' => '#ffffff',
  17. 'border' => '#000000',
  18. 'text' => '#000000',
  19. 'link' => '#f35029',
  20. 'url' => '',
  21. );
  22. /**
  23. * Add Print styles
  24. */
  25. add_theme_support( 'print-style' );
  26. }
  27. add_action( 'after_setup_theme', 'rebalance_wpcom_setup' );
  28. /**
  29. * Enqueue wp.com-specific styles
  30. */
  31. function rebalance_wpcom_styles() {
  32. wp_enqueue_style( 'rebalance-wpcom', get_template_directory_uri() . '/inc/style-wpcom.css', '20160418' );
  33. }
  34. add_action( 'wp_enqueue_scripts', 'rebalance_wpcom_styles' );
  35. /**
  36. * De-queue Google fonts if custom fonts are being used instead.
  37. */
  38. function rebalance_dequeue_fonts() {
  39. if ( class_exists( 'TypekitData' ) && class_exists( 'CustomDesign' ) && CustomDesign::is_upgrade_active() ) {
  40. $customfonts = TypekitData::get( 'families' );
  41. if ( $customfonts['headings']['id'] && $customfonts['body-text']['id'] ) {
  42. wp_dequeue_style( 'rebalance-fonts' );
  43. }
  44. }
  45. }
  46. add_action( 'wp_enqueue_scripts', 'rebalance_dequeue_fonts' );