-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathfunctions.php
52 lines (43 loc) · 1.14 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
<?php
require_once __DIR__ . '/vendor/autoload.php';
new \Timber\Timber();
if (!class_exists('Timber')) {
add_action('admin_notices', function () {
echo '<div class="error"><p>Timber not working. Run composer install in current path template</p></div>';
});
return;
}
// Templates search path
Timber::$dirname = array(
'templates',
'templates/views',
'templates/partials',
'templates/partials/woocommerce',
'dist/img',
);
// Run classes App
new App\StarterSite();
// DEBUG
// Shameless debug function
// Beware: will overide WP_DEBUG, and always dump
function ddump($what)
{
echo '<pre>';
var_dump($what);
echo '</pre>';
}
// THEME OPTIONS
include 'functions-theme-options.php';
include 'functions-theme-options-social-links.php';
include 'functions-theme-options-contact-infos.php';
// TODO: move this elsewhere
// Disable TinyMCE automatic paragraph removal
function remove_wpautop($content)
{
global $post;
// Remove the filter
remove_filter('the_content', 'wpautop');
return $content;
}
// Disable TinyMCE automatic paragraph removal
add_filter('the_content', 'remove_wpautop', 9);