-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathfunctions.php
954 lines (854 loc) · 31.8 KB
/
functions.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
<?php
/**
* This file adds actions, filters, and functions to the theme.
*
* @link https://developer.wordpress.org/themes/basics/theme-functions/
*
* @package aegis
* @author Atmostfear Entertainment
* @license GNU General Public License v2 or later
* @link https://github.com/aegiswp/theme/
* @since 1.0.0
*/
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* This function initializes the theme by setting up support for several core WordPress features:
* - Enqueues editor styles to match the theme's front-end appearance in the block editor.
* @link https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-support/#editor-styles
* - Enables support for custom CSS units like 'rem', 'em', 'vw', and 'vh' in the block editor.
* @link https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-support/#custom-css-units
* - Adds support for responsive embeds to ensure embedded content scales properly on all devices.
* @link https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-support/#responsive-embedded-content
* - Disables default WordPress core block patterns to customize the editor experience.
* @link https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-support/#block-patterns
* - Disables loading of remote block patterns for enhanced security and control.
* - Removes WooCommerce-specific block patterns if WooCommerce is installed.
*
* @since 1.0.0
* @return void
*/
function aegis_theme_support() {
// Enqueue Editor styles.
// Adds a stylesheet for the block editor to match the theme's frontend styles.
add_editor_style('style.css');
// Enable support for custom units.
// Allows the theme to support custom CSS units like 'rem', 'em', 'vw', and 'vh' in the block editor.
add_theme_support('custom-units', array('rem', 'em', 'vw', 'vh'));
// Enable support for responsive embeds.
// Makes embedded content like videos and iframes responsive.
add_theme_support('responsive-embeds');
// Disable WordPress Block Patterns.
// Removes support for default WordPress core block patterns.
remove_theme_support('core-block-patterns');
// Disable loading of remote Block Patterns.
// Prevents loading of block patterns from remote sources.
add_filter('should_load_remote_block_patterns', '__return_false');
// Disable WooCommerce Block Patterns.
// Removes support for WooCommerce-specific block patterns.
remove_theme_support('woocommerce-blocks-patterns');
}
add_action('after_setup_theme', 'aegis_theme_support');
/**
* Enqueue theme styles and scripts.
*
* This function enqueues the main stylesheet and JavaScript files required for the theme.
* - Enqueues the main stylesheet (`style.css`) to ensure that it is loaded on the frontend.
* @link https://developer.wordpress.org/reference/functions/wp_enqueue_style/
* - Enqueues the global JavaScript file (`index.js`) and additional scripts, ensuring they are loaded in the correct order and position.
* @link https://developer.wordpress.org/reference/functions/wp_enqueue_script/
* - Ensures that all scripts and styles use the theme's version for cache-busting purposes.
*
* @since 1.0.0
* @return void
*/
function aegis_theme_styles() {
// Enqueue the main stylesheet for the theme.
// This function adds the main stylesheet (`style.css`) to the theme, ensuring it is loaded on the frontend.
wp_enqueue_style('aegis-global-style', get_template_directory_uri() . '/style.css', array(), wp_get_theme()->get('Version'));
// Enqueue the global script.
// This function adds the global JavaScript file (`index.js`) to the theme, ensuring it is loaded on the frontend.
wp_enqueue_script('aegis-global-script', get_template_directory_uri() . '/assets/js/index.js', array(), wp_get_theme()->get('Version'), true);
// Enqueue the animations script.
// This function adds the animations JavaScript file (`animations.js`) to the theme, ensuring it is loaded on the frontend.
wp_enqueue_script('aegis-animations-script', get_template_directory_uri() . '/assets/js/animations.js', array(), wp_get_theme()->get('Version'), true);
}
add_action('wp_enqueue_scripts', 'aegis_theme_styles');
/**
* Register Block Pattern Categories.
*
* This function registers custom block pattern categories to organize block patterns
* within the block editor. Categories help users find patterns quickly by grouping them
* under meaningful labels.
*
* Uses `register_block_pattern_category()` to define new pattern categories.
* @link https://developer.wordpress.org/reference/functions/register_block_pattern_category/
* Provides custom labels and descriptions for each category to improve the user experience.
*
* @since 1.0.0
* @return void
*/
function aegis_register_block_categories() {
// Registers: About Pattern Category
register_block_pattern_category(
'about',
array(
'label' => _x( 'About', 'Block pattern category', 'aegis' ),
'description' => __( 'A collection of About Patterns.', 'aegis' ),
)
);
// Registers: Archives Pattern Category
register_block_pattern_category(
'archives',
array(
'label' => _x( 'Archives', 'Block pattern category', 'aegis' ),
'description' => __( 'A collection of Archive Patterns.', 'aegis' ),
)
);
// Registers: Audio Pattern Category
register_block_pattern_category(
'audio',
array(
'label' => _x( 'Audio', 'Block pattern category', 'aegis' ),
'description' => __( 'A collection of Audio Patterns.', 'aegis' ),
)
);
// Registers: Blog Pattern Category
register_block_pattern_category(
'blog',
array(
'label' => _x( 'Blog', 'Block pattern category', 'aegis' ),
'description' => __( 'A collection of Blog Patterns.', 'aegis' ),
)
);
// Registers: eCommerce Pattern Category
register_block_pattern_category(
'ecommerce',
array(
'label' => _x( 'eCommerce', 'Block pattern category', 'aegis' ),
'description' => __( 'A collection of eCommerce Patterns.', 'aegis' ),
)
);
// Registers: Events Pattern Category
register_block_pattern_category(
'events',
array(
'label' => _x( 'Events', 'Block pattern category', 'aegis' ),
'description' => __( 'A collection of Events Patterns.', 'aegis' ),
)
);
// Registers: FAQ Pattern Category
register_block_pattern_category(
'faq',
array(
'label' => _x( 'FAQ', 'Block pattern category', 'aegis' ),
'description' => __( 'A collection of FAQ Patterns.', 'aegis' ),
)
);
// Registers: Hero Pattern Category
register_block_pattern_category(
'hero',
array(
'label' => _x( 'Hero', 'Block pattern category', 'aegis' ),
'description' => __( 'A collection of Hero Patterns.', 'aegis' ),
)
);
// Registers: Pricing Category
register_block_pattern_category(
'pricing',
array(
'label' => _x( 'Pricing', 'Block pattern category', 'aegis' ),
'description' => __( 'A collection of Pricing Patterns.', 'aegis' ),
)
);
// Registers: Video Category
register_block_pattern_category(
'video',
array(
'label' => _x( 'Video', 'Block pattern category', 'aegis' ),
'description' => __( 'A collection of Video Patterns.', 'aegis' ),
)
);
}
add_action( 'init', 'aegis_register_block_categories' );
/**
* Register Custom Block Styles.
*
* This function registers multiple custom styles for the `core blocks` to enhance
* the visual options available within the block editor. Custom styles allow users to
* apply different pre-defined appearances to the button block, providing flexibility
* and creativity without additional custom CSS.
*
* Uses `register_block_style()` to define each style for the `core blocks`.
* @link https://developer.wordpress.org/reference/functions/register_block_style/
*
* @since 1.0.0
* @return void
*/
function aegis_register_block_styles() {
/**
* Register styles for the Core Button Block.
*
* This section registers a collection of styles for the `core/button` block.
*
* For more details on the Core Button Block, see:
* @link https://developer.wordpress.org/block-editor/reference-guides/core-blocks/#button
*
* @since 1.0.0
*/
// Registers: 3D Push Style
register_block_style(
'core/button',
array(
'name' => '3d-push',
'label' => esc_html__( '3D Push', 'aegis' ),
)
);
// Registers: Bubble Pop Style
register_block_style(
'core/button',
array(
'name' => 'bubble-pop',
'label' => esc_html__( 'Bubble Pop', 'aegis' ),
)
);
// Registers: Center Fill Style
register_block_style(
'core/button',
array(
'name' => 'center-fill',
'label' => esc_html__( 'Center Fill', 'aegis' ),
)
);
// Registers: Color Wipe Style
register_block_style(
'core/button',
array(
'name' => 'color-wipe',
'label' => esc_html__( 'Color Wipe', 'aegis' ),
)
);
// Registers: Dense Shadow Style
register_block_style(
'core/button',
array(
'name' => 'dense-shadow',
'label' => esc_html__( 'Dense Shadow', 'aegis' ),
)
);
// Registers: Outline Border Style
register_block_style(
'core/button',
array(
'name' => 'outline-border',
'label' => esc_html__( 'Outline Border', 'aegis' ),
)
);
// Registers: Outline Shadow Style
register_block_style(
'core/button',
array(
'name' => 'outline-shadow',
'label' => esc_html__( 'Outline Shadow', 'aegis' ),
)
);
// Registers: Soft Fade Style
register_block_style(
'core/button',
array(
'name' => 'soft-fade',
'label' => esc_html__( 'Soft Fade', 'aegis' ),
)
);
// Registers: Split Reveal Style
register_block_style(
'core/button',
array(
'name' => 'split-reveal',
'label' => esc_html__( 'Split Reveal', 'aegis' ),
)
);
// Registers: Underline Border Style
register_block_style(
'core/button',
array(
'name' => 'underline-border',
'label' => esc_html__( 'Underline Border', 'aegis' ),
)
);
/**
* Register styles for the Core Image Block.
*
* This section registers a collection of styles for the `core/image` block.
*
* For more details on the Core Image Block, see:
* @link https://developer.wordpress.org/block-editor/reference-guides/core-blocks/#image
*
* @since 1.0.0
*/
// Registers: Color Overlay Style
register_block_style(
'core/image',
array(
'name' => 'color-overlay',
'label' => esc_html__( 'Color Overlay', 'aegis' ),
)
);
// Registers: Ease Out Style
register_block_style(
'core/image',
array(
'name' => 'ease-out',
'label' => esc_html__( 'Ease Out', 'aegis' ),
)
);
// Registers: Fade Scale Style
register_block_style(
'core/image',
array(
'name' => 'fade-scale',
'label' => esc_html__( 'Fade Scale', 'aegis' ),
)
);
// Registers: Flip Hover Style
register_block_style(
'core/image',
array(
'name' => 'flip-hover',
'label' => esc_html__( 'Flip Hover', 'aegis' ),
)
);
// Registers: Grayscale Hover Style
register_block_style(
'core/image',
array(
'name' => 'grayscale-hover',
'label' => esc_html__( 'Grayscale Hover', 'aegis' ),
)
);
// Registers: Reveal Hover Style
register_block_style(
'core/image',
array(
'name' => 'reveal-hover',
'label' => esc_html__( 'Reveal Hover', 'aegis' ),
)
);
// Registers: Rotate Hover Style
register_block_style(
'core/image',
array(
'name' => 'rotate-hover',
'label' => esc_html__( 'Rotate Hover', 'aegis' ),
)
);
// Registers: Shine Hover Style
register_block_style(
'core/image',
array(
'name' => 'shine-hover',
'label' => esc_html__( 'Shine Hover', 'aegis' ),
)
);
// Registers: Split Reveal Style
register_block_style(
'core/image',
array(
'name' => 'split-reveal',
'label' => esc_html__( 'Split Reveal', 'aegis' ),
)
);
// Registers: Zoom Hover Style
register_block_style(
'core/image',
array(
'name' => 'zoom-hover',
'label' => esc_html__( 'Zoom Hover', 'aegis' ),
)
);
/**
* Register style for the Core Navigation Block.
*
* This section registers a style for the `core/navigation` block.
*
* For more details on the Core Navigation Block, see:
* @link https://developer.wordpress.org/block-editor/reference-guides/core-blocks/#navigation
*
* @since 1.0.0
*/
// Registers: Mega Menu
register_block_style(
'core/navigation-submenu',
array(
'name' => 'mega-menu',
'label' => esc_html__( 'Mega Menu', 'aegis' ),
)
);
/**
* Register style for the Core Post Date Block.
*
* This section registers a style for the `core/post-date` block.
*
* For more details on the Core Post Date Block, see:
* @link https://developer.wordpress.org/block-editor/reference-guides/core-blocks/#date
*
* @since 1.0.0
*/
// Registers: Hide Underline Style
register_block_style(
'core/post-date',
array(
'name' => 'hide-underline',
'label' => esc_html__( 'Hide Underline', 'aegis' ),
)
);
/**
* Register style for the Core Post Title Block.
*
* This section registers a style for the `core/post-title` block.
*
* For more details on the Core Post Title Block, see:
* @link https://developer.wordpress.org/block-editor/reference-guides/core-blocks/#title
*
* @since 1.0.0
*/
// Registers: Hide Underline Style
register_block_style(
'core/post-title',
array(
'name' => 'hide-underline',
'label' => esc_html__( 'Hide Underline', 'aegis' ),
)
);
/**
* Register style for the Core Video Block.
*
* This section registers a style for the `core/video` block,
*
* For more details on the Core Video Block, see:
* @link https://developer.wordpress.org/block-editor/reference-guides/core-blocks/#video
*
* @since 1.0.0
*/
// Register: Dark Shadow Style
register_block_style(
'core/video',
array(
'name' => 'dark-shadow',
'label' => esc_html__( 'Dark Shadow', 'aegis' ),
)
);
}
add_action( 'init', 'aegis_register_block_styles' );
/**
* Enqueue CSS for the Core Block styles.
*
* The `wp_enqueue_block_style()` function allows us to enqueue a stylesheet
* for a specific block. These will only get loaded when the block is rendered
* (both in the editor and on the front end), improving performance
* and reducing the amount of data requested by visitors.
*
* @since 1.0.0
* @return void
*/
function aegis_enqueue_block_styles() {
/**
* Enqueue styles for the Core Button Block.
*
* This section enqueues the CSS styles for the `core/button` block.
*
* For more details on the Core Button Block, see:
* @link https://developer.wordpress.org/block-editor/reference-guides/core-blocks/#button
*
* @since 1.0.0
*/
// Enqueues: 3D Push Style
wp_enqueue_block_style(
'core/button',
array(
'handle' => 'aegis-core-button-3d-push',
'src' => get_parent_theme_file_uri( 'assets/css/core-button-3d-push.css' ),
'ver' => wp_get_theme( get_template() )->get( 'Version' ),
'path' => get_parent_theme_file_path( 'assets/css/core-button-3d-push.css' ),
)
);
// Enqueues: Bubble Pop Style
wp_enqueue_block_style(
'core/button',
array(
'handle' => 'aegis-core-button-bubble-pop',
'src' => get_parent_theme_file_uri( 'assets/css/core-button-bubble-pop.css' ),
'ver' => wp_get_theme( get_template() )->get( 'Version' ),
'path' => get_parent_theme_file_path( 'assets/css/core-button-bubble-pop.css' ),
)
);
// Enqueues: Center Fill Style
wp_enqueue_block_style(
'core/button',
array(
'handle' => 'aegis-core-button-center-fill',
'src' => get_parent_theme_file_uri( 'assets/css/core-button-center-fill.css' ),
'ver' => wp_get_theme( get_template() )->get( 'Version' ),
'path' => get_parent_theme_file_path( 'assets/css/core-button-center-fill.css' ),
)
);
// Enqueues: Color Wipe Style
wp_enqueue_block_style(
'core/button',
array(
'handle' => 'aegis-core-button-color-wipe',
'src' => get_parent_theme_file_uri( 'assets/css/core-button-color-wipe.css' ),
'ver' => wp_get_theme( get_template() )->get( 'Version' ),
'path' => get_parent_theme_file_path( 'assets/css/core-button-color-wipe.css' ),
)
);
// Enqueues: Dense Shadow Style
wp_enqueue_block_style(
'core/button',
array(
'handle' => 'aegis-core-button-dense-shadow',
'src' => get_parent_theme_file_uri( 'assets/css/core-button-dense-shadow.css' ),
'ver' => wp_get_theme( get_template() )->get( 'Version' ),
'path' => get_parent_theme_file_path( 'assets/css/core-button-dense-shadow.css' ),
)
);
// Enqueues: Outline Border Style
wp_enqueue_block_style(
'core/button',
array(
'handle' => 'aegis-core-button-outline-border',
'src' => get_parent_theme_file_uri( 'assets/css/core-button-outline-border.css' ),
'ver' => wp_get_theme( get_template() )->get( 'Version' ),
'path' => get_parent_theme_file_path( 'assets/css/core-button-outline-border.css' ),
)
);
// Enqueues: Outline Shadow Style
wp_enqueue_block_style(
'core/button',
array(
'handle' => 'aegis-core-button-outline-shadow',
'src' => get_parent_theme_file_uri( 'assets/css/core-button-outline-shadow.css' ),
'ver' => wp_get_theme( get_template() )->get( 'Version' ),
'path' => get_parent_theme_file_path( 'assets/css/core-button-outline-shadow.css' ),
)
);
// Enqueues: Split Reveal Style
wp_enqueue_block_style(
'core/button',
array(
'handle' => 'aegis-core-button-split-reveal',
'src' => get_parent_theme_file_uri( 'assets/css/core-button-split-reveal.css' ),
'ver' => wp_get_theme( get_template() )->get( 'Version' ),
'path' => get_parent_theme_file_path( 'assets/css/core-button-split-reveal.css' ),
)
);
// Enqueues: Underline Border Style
wp_enqueue_block_style(
'core/button',
array(
'handle' => 'aegis-core-button-underline-border',
'src' => get_parent_theme_file_uri( 'assets/css/core-button-underline-border.css' ),
'ver' => wp_get_theme( get_template() )->get( 'Version' ),
'path' => get_parent_theme_file_path( 'assets/css/core-button-underline-border.css' ),
)
);
/**
* Enqueue style for the Core Details Block.
*
* This section enqueues the CSS style for the `core/details` block.
*
* For more details on the Core Details Block, see:
* @link https://developer.wordpress.org/block-editor/reference-guides/core-blocks/#details
*
* @since 1.0.0
*/
// Enqueues: Details Style
wp_enqueue_block_style(
'core/details',
array(
'handle' => 'aegis-core-details-block',
'src' => get_parent_theme_file_uri( 'assets/css/core-details-block.css' ),
'ver' => wp_get_theme( get_template() )->get( 'Version' ),
'path' => get_parent_theme_file_path( 'assets/css/core-details-block.css' ),
)
);
/**
* Enqueue style for the Core Heading Block.
*
* This section enqueues the CSS style for the `core/heading` block.
*
* For more details on the Core Heading Block, see:
* @link https://developer.wordpress.org/block-editor/reference-guides/core-blocks/#heading
*
* @since 1.0.0
*/
// Enqueues: Hide Underline Style
wp_enqueue_block_style(
'core/heading',
array(
'handle' => 'aegis-core-post-date-hide-underline',
'src' => get_parent_theme_file_uri( 'assets/css/core-blocks-hide-underline.css' ),
'ver' => wp_get_theme( get_template() )->get( 'Version' ),
'path' => get_parent_theme_file_path( 'assets/css/core-post-title-hide-underline.css' ),
)
);
/**
* Enqueue style for the Core Image Block.
*
* This section enqueues the CSS style for the `core/image` block.
*
* For more details on the Core Image Block, see:
* @link https://developer.wordpress.org/block-editor/reference-guides/core-blocks/#image
*
* @since 1.0.0
*/
// Enqueues: Color Overlay Style
wp_enqueue_block_style(
'core/image',
array(
'handle' => 'aegis-core-image-color-overlay',
'src' => get_parent_theme_file_uri( 'assets/css/core-image-color-overlay.css' ),
'ver' => wp_get_theme( get_template() )->get( 'Version' ),
'path' => get_parent_theme_file_path( 'assets/css/core-image-color-overlay.css' ),
)
);
// Enqueues: Ease Out Style
wp_enqueue_block_style(
'core/image',
array(
'handle' => 'aegis-core-image-ease-out',
'src' => get_parent_theme_file_uri( 'assets/css/core-image-ease-out.css' ),
'ver' => wp_get_theme( get_template() )->get( 'Version' ),
'path' => get_parent_theme_file_path( 'assets/css/core-image-ease-out.css' ),
)
);
// Enqueues: Fade Scale Style
wp_enqueue_block_style(
'core/image',
array(
'handle' => 'aegis-core-image-fade-scale',
'src' => get_parent_theme_file_uri( 'assets/css/core-image-fade-scale.css' ),
'ver' => wp_get_theme( get_template() )->get( 'Version' ),
'path' => get_parent_theme_file_path( 'assets/css/core-image-fade-scale.css' ),
)
);
// Enqueues: Flip Hover Style
wp_enqueue_block_style(
'core/image',
array(
'handle' => 'aegis-core-image-flip-hover',
'src' => get_parent_theme_file_uri( 'assets/css/core-image-flip-hover.css' ),
'ver' => wp_get_theme( get_template() )->get( 'Version' ),
'path' => get_parent_theme_file_path( 'assets/css/core-image-flip-hover.css' ),
)
);
// Enqueues: Grayscale Hover Style
wp_enqueue_block_style(
'core/image',
array(
'handle' => 'aegis-core-image-grayscale-hover',
'src' => get_parent_theme_file_uri( 'assets/css/core-image-grayscale-hover.css' ),
'ver' => wp_get_theme( get_template() )->get( 'Version' ),
'path' => get_parent_theme_file_path( 'assets/css/core-image-grayscale-hover.css' ),
)
);
// Enqueues: Reveal Hover Style
wp_enqueue_block_style(
'core/image',
array(
'handle' => 'aegis-core-image-reveal-hover',
'src' => get_parent_theme_file_uri( 'assets/css/core-image-reveal-hover.css' ),
'ver' => wp_get_theme( get_template() )->get( 'Version' ),
'path' => get_parent_theme_file_path( 'assets/css/core-image-reveal-hover.css' ),
)
);
// Enqueues: Rotate Hover Style
wp_enqueue_block_style(
'core/image',
array(
'handle' => 'aegis-core-image-rotate-hover',
'src' => get_parent_theme_file_uri( 'assets/css/core-image-rotate-hover.css' ),
'ver' => wp_get_theme( get_template() )->get( 'Version' ),
'path' => get_parent_theme_file_path( 'assets/css/core-image-rotate-hover.css' ),
)
);
// Enqueues: Shine Hover Style
wp_enqueue_block_style(
'core/image',
array(
'handle' => 'aegis-core-image-shine-hover',
'src' => get_parent_theme_file_uri( 'assets/css/core-image-shine-hover.css' ),
'ver' => wp_get_theme( get_template() )->get( 'Version' ),
'path' => get_parent_theme_file_path( 'assets/css/core-image-shine-hover.css' ),
)
);
// Enqueues: Split Reveal Style
wp_enqueue_block_style(
'core/image',
array(
'handle' => 'aegis-core-image-split-reveal',
'src' => get_parent_theme_file_uri( 'assets/css/core-image-split-reveal.css' ),
'ver' => wp_get_theme( get_template() )->get( 'Version' ),
'path' => get_parent_theme_file_path( 'assets/css/core-image-split-reveal.css' ),
)
);
// Enqueues: Zoom Hover Style
wp_enqueue_block_style(
'core/image',
array(
'handle' => 'aegis-core-image-zoom-hover',
'src' => get_parent_theme_file_uri( 'assets/css/core-image-zoom-hover.css' ),
'ver' => wp_get_theme( get_template() )->get( 'Version' ),
'path' => get_parent_theme_file_path( 'assets/css/core-image-zoom-hover.css' ),
)
);
/**
* Enqueue style for the Core List Block.
*
* This section enqueues the CSS style for the `core/list` block.
*
* For more details on the Core List Block, see:
* @link https://developer.wordpress.org/block-editor/reference-guides/core-blocks/#list
*
* @since 1.0.0
*/
// Enqueues: Flip Hover Style
wp_enqueue_block_style(
'core/list',
array(
'handle' => 'aegis-core-list-disc',
'src' => get_parent_theme_file_uri( 'assets/css/core-list-block.css' ),
'ver' => wp_get_theme( get_template() )->get( 'Version' ),
'path' => get_parent_theme_file_path( 'assets/css/core-list-block.css' ),
)
);
/**
* Enqueue styles for the Core Navigation Block.
*
* This section enqueues the CSS styles for the `core/navigation` block.
*
* For more details on the Core Navigation Block, see:
* @link https://developer.wordpress.org/block-editor/reference-guides/core-blocks/#navigation
*
* @since 1.0.0
*/
// Enqueues: Navigation Style
wp_enqueue_block_style(
'core/navigation',
array(
'handle' => 'aegis-core-navigation-block',
'src' => get_parent_theme_file_uri( 'assets/css/core-navigation-block.css' ),
'ver' => wp_get_theme( get_template() )->get( 'Version' ),
'path' => get_parent_theme_file_path( 'assets/css/core-navigation-block.css' ),
)
);
// Enqueues: Navigation Mega Menu Style
wp_enqueue_block_style(
'core/navigation-submenu',
array(
'handle' => 'aegis-core-navigation-mega-menu',
'src' => get_parent_theme_file_uri( 'assets/css/core-navigation-mega-menu.css' ),
'ver' => wp_get_theme( get_template() )->get( 'Version' ),
'path' => get_parent_theme_file_path( 'assets/css/core-navigation-mega-menu.css' ),
)
);
/**
* Enqueue style for the Core Post Date Block.
*
* This section enqueues the CSS style for the `core/post-date` block.
*
* For more details on the Core Post Date Block, see:
* @link https://developer.wordpress.org/block-editor/reference-guides/core-blocks/#date
*
* @since 1.0.0
*/
// Enqueues: Hide Underline Style
wp_enqueue_block_style(
'core/post-date',
array(
'handle' => 'aegis-core-post-date-hide-underline',
'src' => get_parent_theme_file_uri( 'assets/css/core-blocks-hide-underline.css' ),
'ver' => wp_get_theme( get_template() )->get( 'Version' ),
'path' => get_parent_theme_file_path( 'assets/css/core-post-title-hide-underline.css' ),
)
);
/**
* Enqueue style for the Core Post Title Block.
*
* This section enqueues the CSS style for the `core/post-title` block.
*
* For more details on the Core Post Title Block, see:
* @link https://developer.wordpress.org/block-editor/reference-guides/core-blocks/#title
*
* @since 1.0.0
*/
// Enqueues: Hide Underline Style
wp_enqueue_block_style(
'core/post-title',
array(
'handle' => 'aegis-core-post-title-hide-underline',
'src' => get_parent_theme_file_uri( 'assets/css/core-blocks-hide-underline.css' ),
'ver' => wp_get_theme( get_template() )->get( 'Version' ),
'path' => get_parent_theme_file_path( 'assets/css/core-blocks-hide-underline.css' ),
)
);
/**
* Enqueue style for the Core Video Block.
*
* This section enqueues the CSS style for the `core/video` block.
*
* For more details on the Core Video Block, see:
* @link https://developer.wordpress.org/block-editor/reference-guides/core-blocks/#video
*
* @since 1.0.0
*/
// Enqueues: Dark Shadow Style
wp_enqueue_block_style(
'core/video',
array(
'handle' => 'aegis-core-video-dark-shadow',
'src' => get_parent_theme_file_uri( 'assets/css/core-video-dark-shadow.css' ),
'ver' => wp_get_theme( get_template() )->get( 'Version' ),
'path' => get_parent_theme_file_path( 'assets/css/core-video-dark-shadow.css' ),
)
);
}
add_action('init', 'aegis_enqueue_block_styles');
/**
* Query whether WooCommerce is activated.
*
* @since 1.0.0
* @return bool True if WooCommerce is activated, false otherwise.
*/
function aegis_is_woocommerce_activated() {
return class_exists('WooCommerce');
}
/**
* Include WooCommerce support.
*
* @since 1.0.0
* @return void
*/
function aegis_include_woocommerce_support() {
if ( aegis_is_woocommerce_activated() ) {
// Add theme support for WooCommerce features
add_theme_support( 'woocommerce' );
add_theme_support( 'wc-product-gallery-zoom' );
add_theme_support( 'wc-product-gallery-lightbox' );
add_theme_support( 'wc-product-gallery-slider' );
// Set WooCommerce image sizes
add_theme_support('woocommerce', array(
'thumbnail_image_width' => 480,
'single_image_width' => 1920,
));
/**
* Change number of products per row to 4.
*/
add_filter('loop_shop_columns', 'aegis_loop_columns', 999);
if (!function_exists('aegis_loop_columns')) {
function aegis_loop_columns() {
return 4; // 4 products per row.
}
}
}
}