functions.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. if ( ! function_exists( 'quadrat_support' ) ) :
  3. function quadrat_support() {
  4. // Enqueue editor styles.
  5. add_editor_style(
  6. array(
  7. '/assets/theme.css',
  8. )
  9. );
  10. // Add support for core custom logo.
  11. add_theme_support(
  12. 'custom-logo',
  13. array(
  14. 'height' => 35,
  15. 'width' => 150,
  16. 'flex-width' => true,
  17. 'flex-height' => true,
  18. )
  19. );
  20. // Add support for starter content
  21. include get_stylesheet_directory() . '/inc/starter-content.php';
  22. add_theme_support(
  23. 'starter-content',
  24. $quadrat_starter_content
  25. );
  26. // This theme uses wp_nav_menu() in two locations.
  27. register_nav_menus(
  28. array(
  29. 'primary' => __( 'Primary Navigation', 'quadrat' ),
  30. )
  31. );
  32. remove_theme_support( 'block-templates' );
  33. }
  34. add_action( 'after_setup_theme', 'quadrat_support' );
  35. endif;
  36. /**
  37. * Enqueue scripts and styles.
  38. */
  39. function quadrat_scripts() {
  40. // Enqueue front-end styles.
  41. wp_enqueue_style( 'quadrat-styles', get_stylesheet_directory_uri() . '/assets/theme.css', array( 'blockbase-ponyfill' ), wp_get_theme()->get( 'Version' ) );
  42. }
  43. add_action( 'wp_enqueue_scripts', 'quadrat_scripts' );
  44. /**
  45. * Block Patterns.
  46. */
  47. require get_stylesheet_directory() . '/inc/block-patterns.php';
  48. /**
  49. * Block Styles.
  50. */
  51. require get_stylesheet_directory() . '/inc/block-styles.php';