-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.php
More file actions
102 lines (89 loc) · 2.9 KB
/
functions.php
File metadata and controls
102 lines (89 loc) · 2.9 KB
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
<?php
/**
* Pabelog Theme.
*
* A theme used on pabelog.com.
*
* @package Pabelog Theme
* @author Nadiar AS
* @link https://github.com/HackinBlog/pabelog-theme
* @copyright Copyright (c) 2019, Nadiar AS
* @license MIT
*/
require_once('lib/const.php');
require_once('lib/filter.php');
load_child_theme_textdomain('pabelog');
// Theme support
add_theme_support('html5', array('comment-list', 'comment-form', 'search-form', 'gallery', 'caption'));
add_theme_support('genesis-responsive-viewport');
add_theme_support('Genesis-accessibility', array(
'404-page',
'drop-down-menu',
'headings',
'rems',
'search-form',
'skip-links',
));
add_theme_support('Genesis-footer-widgets', 3);
// Pabelog support
function console($message)
{
if (PABELOG_THEME_DEBUG) {
echo '<script type="text/javascript">console.log("' . $message . '");</script>';
}
}
function pabelog_deregister_scripts()
{
remove_action('wp_head', 'print_emoji_detection_script', 7);
remove_action('admin_print_scripts', 'print_emoji_detection_script');
remove_action('genesis_footer', 'genesis_do_footer');
remove_action('wp_print_styles', 'print_emoji_styles');
remove_action('admin_print_styles', 'print_emoji_styles');
remove_filter('the_content_feed', 'wp_staticize_emoji');
remove_filter('comment_text_rss', 'wp_staticize_emoji');
remove_filter('wp_mail', 'wp_staticize_emoji_for_email');
add_filter('tiny_mce_plugins', 'disable_emojis_tinymce');
add_filter('wp_resource_hints', 'disable_emojis_remove_dns_prefetch', 10, 2);
wp_deregister_script('wp-embed');
wp_deregister_script('jquery');
wp_deregister_style('wp-block-library');
wp_dequeue_style('ez-icomoon');
wp_dequeue_style('ez-toc');
}
add_action('wp_enqueue_scripts', 'pabelog_deregister_scripts');
function pabelog_load_tachyons_css()
{
wp_enqueue_style('tachyons', PABELOG_NODE_MODULES_DIR . '/tachyons/css/tachyons.min.css');
}
add_action('wp_enqueue_scripts', 'pabelog_load_tachyons_css', 5);
function pabelog_custom_footer()
{
?>
<div class="bt b--light-gray w-two-thirds-ns center mt5">
<p class="font-color2 f5 tc">© Copyright 2019 <a href="/">Pabelog</a> · All Rights Reserved</p>
</div>
<?php
}
add_action('genesis_footer', 'pabelog_custom_footer');
// `wpautop` This is required to remove extra <p> tag added to description by WordPress
// Add Title and Description for WordPress category page
function pabelog_archive_header()
{
$slug = '';
if (is_category()) {
$slug = 'Kategori: ';
}
if (is_tag()) {
$slug = 'Tag: ';
}
if (is_archive()) {
echo '<div class="pl4 pl0-ns pr4 pl0-ns"><div class=""><h1 class="f-subheadline-ns lh-title f1">';
echo single_cat_title($slug, true);
echo '</h1></div>';
echo '<p class="lh-copy mb5">';
echo term_description();
echo '</p></div>';
}
}
remove_filter('term_description', 'wpautop');
add_action('genesis_before_loop', 'pabelog_archive_header');