forked from zgreen/MITlibraries-child
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.php
More file actions
78 lines (57 loc) · 1.81 KB
/
Copy pathfunctions.php
File metadata and controls
78 lines (57 loc) · 1.81 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
<?php
add_action( 'after_setup_theme', 'remove_child_theme_support');
function remove_child_theme_support() {
remove_theme_support('custom-background');
}
function betterChildBreadcrumbs() {
global $post;
if(is_search()) {
echo "<span>Search</span>";
}
if(!is_child_page() && is_page() || is_category() || is_single()) {
echo "<span>".the_title()."</span>";
return;
}
if(is_child_page()) {
$parentLink = get_permalink($post->post_parent);
$parentTitle = get_the_title($post->post_parent);
$startLink = '<a href="';
$endLink = '">';
$closeLink = '</a>';
$parentBreadcrumb = $startLink.$parentLink.$endLink.$parentTitle.$closeLink;
$pageTitle = get_the_title($post);
$pageLink = get_permalink($post);
$childBreadcrumb = $startLink.$pageLink.$endLink.$pageTitle.$closeLink;
}
if ($parentBreadcrumb !="") {echo "<span>".$parentBreadcrumb."</span>";}
if ($childBreadcrumb != "") {echo "<span>".$pageTitle."</span>";}
}
add_action( 'after_setup_theme', 'customHeader' );
function customHeader() {
$args = array(
'width' => 480,
'height' => 200,
'uploads' => true
);
add_theme_support( 'custom-header', $args );
}
// add_theme_support( 'custom-header' );
// Register Child Nav
if(!function_exists('register_child_nav')) {
function register_child_nav() {
register_nav_menu('child-nav', 'Child Nav');
}
add_action( 'init', 'register_child_nav' );
}
if (function_exists('add_theme_support')) { add_theme_support('post-thumbnails'); }
add_image_size('headerImage', 480, 200, true);
if (!function_exists('my_mce_buttons_2')):
function my_mce_buttons_2($buttons) {
/**
* Add in a core button that's disabled by default
*/
$buttons[] = 'hr';
return $buttons;
}
add_filter('mce_buttons_2', 'my_mce_buttons_2');
endif;