-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
88 lines (73 loc) · 2.1 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
<?php
/**
* function.php
*
* @package Tim
*/
namespace fabiankaegy\tim;
add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\enqueue_frontend_assets', 99 );
add_filter( 'jetpack_sharing_counts', '__return_false', 99 );
add_filter( 'jetpack_implode_frontend_css', '__return_false', 99 );
add_action( 'after_setup_theme', __NAMESPACE__ . '\add_theme_supports' );
\add_filter(
'allowed_block_types_all',
function ( $allowed_blocks, $context ) {
if ( 'templates/van-pdf.php' === get_page_template_slug( $context->post->ID ) ) {
return [ 'core/paragraph' ];
}
return $allowed_blocks;
},
20,
2
);
/**
* add theme supports
*/
function add_theme_supports() {
add_theme_support( 'post-thumbnails' );
}
/**
* Enqueue frontend assets
*/
function enqueue_frontend_assets() {
wp_dequeue_script( 'jquery' );
wp_dequeue_style( 'jetpack_css' );
wp_dequeue_script( 'wp-mediaelement' );
wp_dequeue_style( 'wp-mediaelement' );
wp_register_style(
'normalize.css',
get_template_directory_uri() . '/normalize.css',
[],
'8.0.1'
);
wp_register_style(
'van-pdf-styles',
get_template_directory_uri() . '/templates/van-pdf.css',
[ 'normalize.css' ],
filemtime( get_template_directory() . '/templates/van-pdf.css' )
);
wp_register_style(
'bus-plan-interaktiv-styles',
get_template_directory_uri() . '/templates/bus-plan-interaktiv.css',
[ 'normalize.css' ],
filemtime( get_template_directory() . '/templates/bus-plan-interaktiv.css' )
);
wp_register_script(
'bus-plan-interaktiv-js',
get_template_directory_uri() . '/templates/bus-plan-interaktiv.js',
[],
filemtime( get_template_directory() . '/templates/bus-plan-interaktiv.js' ),
true
);
if ( is_page_template( 'templates/van-pdf.php' ) ) {
wp_dequeue_style( 'wp-block-library' );
wp_dequeue_style( 'wp-block-library-theme' );
wp_enqueue_style( 'van-pdf-styles' );
};
if ( is_page_template( 'templates/bus-plan-interaktiv.php' ) ) {
wp_dequeue_style( 'wp-block-library' );
wp_dequeue_style( 'wp-block-library-theme' );
wp_enqueue_style( 'bus-plan-interaktiv-styles' );
wp_enqueue_script( 'bus-plan-interaktiv-js' );
};
}