This repository has been archived by the owner on Dec 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
functions.php
103 lines (88 loc) · 2.92 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
<?php
/*
|--------------------------------------------------------------------------
| Theme Core
|--------------------------------------------------------------------------
|
| Load the Magic. Do not edit. Leave on top
|
*/
require get_template_directory() . '/vendor/autoload.php';
$core = new Parfaitement\Core();
/*
|--------------------------------------------------------------------------
| Theme Setup
|--------------------------------------------------------------------------
|
| Modify to setup theme features as you like.
|
*/
add_action( 'after_setup_theme', function () use ( $core ) {
/**
* Enable plugins to manage the document title
* @link https://developer.wordpress.org/reference/functions/add_theme_support/#title-tag
*/
add_theme_support( 'title-tag' );
/**
* Enable gutenberg editor style
* @link https://developer.wordpress.org/block-editor/developers/themes/theme-support/
*/
add_theme_support( 'editor-styles' );
add_editor_style( '/dist/editor-style.css' );
/**
* Register navigation menus
* @link https://developer.wordpress.org/reference/functions/register_nav_menus/
*/
register_nav_menus( [
'primary_navigation' => __( 'Primary Navigation', 'parfaitement' )
] );
/**
* Enable post thumbnails
* @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
*/
add_theme_support( 'post-thumbnails' );
/**
* Enable HTML5 markup support
* @link https://developer.wordpress.org/reference/functions/add_theme_support/#html5
*/
add_theme_support( 'html5', [ 'caption', 'comment-form', 'comment-list', 'gallery', 'search-form' ] );
/**
* Enable selective refresh for widgets in customizer
* @link https://developer.wordpress.org/themes/advanced-topics/customizer-api/#theme-support-in-sidebars
*/
add_theme_support( 'customize-selective-refresh-widgets' );
/**
* Use main stylesheet for visual editor
* @see resources/assets/styles/layouts/_tinymce.scss
*/
add_editor_style( get_template_directory( '/dist/main.css' ) );
}, 20 );
add_action( 'widgets_init', function () {
/**
* Register sidebars
* @link https://codex.wordpress.org/Widgetizing_Themes#How_to_display_new_Widget_Areas
*/
register_sidebar( [
'name' => 'Primary Sidebar',
'id' => 'sidebar-primary',
'before_widget' => '<div>',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>',
] );
}, 10 );
/*
|--------------------------------------------------------------------------
| Registering ACF Blocks
|--------------------------------------------------------------------------
|
*/
require get_template_directory() . '/inc/acf-blocks.php';
/*
|--------------------------------------------------------------------------
| CUSTOM Functions
|--------------------------------------------------------------------------
|
| Example : $contactForm = new \App\ContactForm();
*/
$login_form = new \App\Login\LoginForm($core, 'user-login-form');