functions.php 1.1 KB

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