functions.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. /**
  3. * Loudness functions and definitions
  4. *
  5. * @link https://developer.wordpress.org/themes/basics/theme-functions/
  6. *
  7. * @package Loudness
  8. * @since Loudness 1.0
  9. */
  10. if ( ! function_exists( 'decibel_support' ) ) :
  11. /**
  12. * Sets up theme defaults and registers support for various WordPress features.
  13. *
  14. * @since Loudness 1.0
  15. *
  16. * @return void
  17. */
  18. function decibel_support() {
  19. // Enqueue editor styles.
  20. add_editor_style( 'style.css' );
  21. }
  22. endif;
  23. add_action( 'after_setup_theme', 'decibel_support' );
  24. if ( ! function_exists( 'decibel_styles' ) ) :
  25. /**
  26. * Enqueue styles.
  27. *
  28. * @since Loudness 1.0
  29. *
  30. * @return void
  31. */
  32. function decibel_styles() {
  33. // Register theme stylesheet.
  34. wp_register_style(
  35. 'loudness-style',
  36. get_stylesheet_directory_uri() . '/style.css',
  37. array(),
  38. wp_get_theme()->get( 'Version' )
  39. );
  40. // Enqueue theme stylesheet.
  41. wp_enqueue_style( 'loudness-style' );
  42. }
  43. endif;
  44. add_action( 'wp_enqueue_scripts', 'decibel_styles' );
  45. function decibel_init() {
  46. if ( ! WP_Block_Pattern_Categories_Registry::get_instance()->is_registered( 'illustrations' ) ) {
  47. register_block_pattern_category( 'illustrations', array( 'label' => __( 'Illustrations', 'loudness' ) ) );
  48. }
  49. register_block_style(
  50. 'core/navigation-link',
  51. array(
  52. 'name' => 'navigation-link-button',
  53. 'label' => __( 'Button', 'loudness' ),
  54. )
  55. );
  56. }
  57. add_action( 'init', 'decibel_init' );