functions.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. /**
  3. * Nook functions and definitions
  4. *
  5. * @link https://developer.wordpress.org/themes/basics/theme-functions/
  6. *
  7. * @package Nook
  8. * @since Nook 1.0
  9. */
  10. declare( strict_types = 1 );
  11. if ( ! function_exists( 'nook_support' ) ) :
  12. /**
  13. * Sets up theme defaults and registers support for various WordPress features.
  14. *
  15. * @since Nook 1.0
  16. *
  17. * @return void
  18. */
  19. function nook_support() {
  20. // Enqueue editor styles.
  21. add_editor_style( 'style.css' );
  22. // Make theme available for translation.
  23. load_theme_textdomain( 'nook' );
  24. }
  25. endif;
  26. add_action( 'after_setup_theme', 'nook_support' );
  27. if ( ! function_exists( 'nook_styles' ) ) :
  28. /**
  29. * Enqueue styles.
  30. *
  31. * @since Nook 1.0
  32. *
  33. * @return void
  34. */
  35. function nook_styles() {
  36. // Register theme stylesheet.
  37. wp_register_style(
  38. 'nook-style',
  39. get_stylesheet_directory_uri() . '/style.css',
  40. array(),
  41. wp_get_theme()->get( 'Version' )
  42. );
  43. // Enqueue theme stylesheet.
  44. wp_enqueue_style( 'nook-style' );
  45. }
  46. endif;
  47. add_action( 'wp_enqueue_scripts', 'nook_styles' );