Guest User

Untitled

a guest
Nov 25th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.09 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4. * @package Make GCDI
  5. */
  6. /**
  7. * The GC Digital Initiatives Child Theme of Make
  8. *
  9. *
  10. * @see MAKE_Setup_Scripts::enqueue_frontend_styles()
  11. */
  12. define( 'TTFMAKE_CHILD_VERSION', '0.1' );
  13.  
  14. /**
  15. * Turn off the parent theme styles.
  16. *
  17. * If you would like to use this child theme to style Make from scratch, rather
  18. * than simply overriding specific style rules, remove the '//' from the
  19. * 'add_filter' line below. This will tell the theme not to enqueue the parent
  20. * stylesheet along with the child one.
  21. */
  22. //add_filter( 'make_enqueue_parent_stylesheet', '__return_false' );
  23.  
  24. /**
  25. * Define a version number for the child theme's stylesheet.
  26. *
  27. * In order to prevent old versions of the child theme's stylesheet from loading
  28. * from a browser's cache, update the version number below each time changes are
  29. * made to the stylesheet.
  30. *
  31. * @uses MAKE_Setup_Scripts::update_version()
  32. */
  33. function childtheme_style_version() {
  34. // Ensure the Make API is available.
  35. if ( ! function_exists( 'Make' ) ) {
  36. return;
  37. }
  38. // Version string to append to the child theme's style.css URL.
  39. $version = '1.0.0'; // <- Update this!
  40. Make()->scripts()->update_version( 'make-main', $version, 'style' );
  41. }
  42. add_action( 'wp_enqueue_scripts', 'childtheme_style_version', 20 );
  43.  
  44. function make_parent_theme_enqueue_styles() {
  45. wp_enqueue_style( 'make-style', get_template_directory_uri() . '/style.css' );
  46. wp_enqueue_style( 'make-gcdi-style',
  47. get_stylesheet_directory_uri() . '/style.css',
  48. array( 'make-style' )
  49. );
  50.  
  51. }
  52. add_action( 'wp_enqueue_scripts', 'make_parent_theme_enqueue_styles' );
  53.  
  54. function gcdi_update_setting_defaults() {
  55. $gcdi_settings = array (
  56. 'general-layout' => array( 'default' => 'boxed' ),
  57. 'background_color' => array( 'default' => 'ff0000' ),
  58. 'font-family-body' => array( 'default' => 'Roboto' ),
  59. );
  60.  
  61. foreach ($gcdi_settings as $id => $settings) {
  62. make_update_thememod_setting_definition( $id, $settings );
  63. Make()->thememod()->set_value( $id, $settings["default"] );
  64. }
  65. }
  66. add_action( 'make_settings_thememod_loaded', 'gcdi_update_setting_defaults' );
Add Comment
Please, Sign In to add comment