functions.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?php
  2. /**
  3. * Adonay functions and definitions
  4. *
  5. * @link https://developer.wordpress.org/themes/basics/theme-functions/
  6. *
  7. * @package Adonay
  8. * @since Adonay 1.0
  9. */
  10. if ( ! function_exists( 'adonay_support' ) ) :
  11. /**
  12. * Sets up theme defaults and registers support for various WordPress features.
  13. *
  14. * @since Adonay 1.0
  15. *
  16. * @return void
  17. */
  18. function adonay_support() {
  19. // Enqueue editor styles.
  20. add_editor_style( 'style.css' );
  21. // Make theme available for translation.
  22. load_theme_textdomain( 'adonay' );
  23. }
  24. endif;
  25. add_action( 'after_setup_theme', 'adonay_support' );
  26. if ( ! function_exists( 'adonay_styles' ) ) :
  27. /**
  28. * Enqueue styles.
  29. *
  30. * @since Adonay 1.0
  31. *
  32. * @return void
  33. */
  34. function adonay_styles() {
  35. // Register theme stylesheet.
  36. wp_register_style(
  37. 'adonay-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( 'adonay-style' );
  44. }
  45. endif;
  46. add_action( 'wp_enqueue_scripts', 'adonay_styles' );
  47. /**
  48. * Register pattern categories.
  49. */
  50. if ( ! function_exists( 'adonay_pattern_categories' ) ) :
  51. /**
  52. * Register pattern categories
  53. *
  54. * @since Adonay 1.0
  55. * @return void
  56. */
  57. function adonay_pattern_categories() {
  58. register_block_pattern_category(
  59. 'page',
  60. array(
  61. 'label' => _x( 'Pages', 'Block pattern category', 'adonay' ),
  62. 'description' => __( 'A collection of full page layouts.', 'adonay' ),
  63. )
  64. );
  65. }
  66. endif;
  67. add_action( 'init', 'adonay_pattern_categories' );