@@ -70,31 +70,31 @@ function roots_title()
70
70
71
71
$ title .= '<span class="category-header topic- ' . $ term ->slug . '"><a href=" ' . home_url (
72
72
'/ ' . $ parent ->slug . '/ ' . $ term ->slug
73
- ) . '"><div><i></i></div><span> ' . $ term ->name . '</span></a></span> ' ;
73
+ ) . '/ "><div><i></i></div><span> ' . $ term ->name . '</span></a></span> ' ;
74
74
75
- // try to get the post's parent/child category/term in case the post url has been customized
76
- // through custom_permalinks
77
- if (get_post_meta ($ post ->ID , 'custom_permalink ' , true ) && $ parent ->slug == "" && $ child_slug == "" ) {
75
+ // try to get the post's parent/child category/term in case the post url has been customized
76
+ // through custom_permalinks
77
+ if (get_post_meta ($ post ->ID , 'custom_permalink ' , true ) && $ parent ->slug == "" && $ child_slug == "" ) {
78
78
79
- $ custom_permalink = str_replace (home_url () . '/ ' , '' , get_permalink ($ post ->ID ));
80
- $ custom_permalink = explode ('/ ' , $ custom_permalink );
81
- $ custom_permalink_category = $ custom_permalink [0 ];
82
- $ custom_permalink_term = $ custom_permalink [1 ];
79
+ $ custom_permalink = str_replace (home_url () . '/ ' , '' , get_permalink ($ post ->ID ));
80
+ $ custom_permalink = explode ('/ ' , $ custom_permalink );
81
+ $ custom_permalink_category = $ custom_permalink [0 ];
82
+ $ custom_permalink_term = $ custom_permalink [1 ];
83
83
84
- $ category_exists = (term_exists ($ custom_permalink_category , 'category ' ) != 0 )
85
- && term_exists ($ custom_permalink_category , 'category ' ) != null ;
84
+ $ category_exists = (term_exists ($ custom_permalink_category , 'category ' ) != 0 )
85
+ && term_exists ($ custom_permalink_category , 'category ' ) != null ;
86
86
87
- $ term_exists = (term_exists ($ custom_permalink_term , '' , 'category ' ) != 0 )
88
- && term_exists ($ custom_permalink_term , '' , 'category ' ) != null ;
87
+ $ term_exists = (term_exists ($ custom_permalink_term , '' , 'category ' ) != 0 )
88
+ && term_exists ($ custom_permalink_term , '' , 'category ' ) != null ;
89
89
90
- if ($ category_exists && $ term_exists ) {
91
- $ title .= ' — <span class="category-header topic- ' .
92
- $ custom_permalink_child . '"><a href=" ' . home_url (
93
- '/ ' . $ custom_permalink_category . '/ ' . $ custom_permalink_term
94
- ) . '"><div><i></i></div><span> ' . $ custom_permalink_term . '</span></a></span> ' ;
95
- }
90
+ if ($ category_exists && $ term_exists ) {
91
+ $ title .= ' — <span class="category-header topic- ' .
92
+ ( isset ( $ custom_permalink_child) ? $ custom_permalink_child : '' ) . '"><a href=" ' . home_url (
93
+ '/ ' . $ custom_permalink_category . '/ ' . $ custom_permalink_term
94
+ ) . '"><div><i></i></div><span> ' . $ custom_permalink_term . '</span></a></span> ' ;
95
+ }
96
96
97
- }
97
+ }
98
98
99
99
return apply_filters ('single_term_title ' , $ title );
100
100
} elseif (is_post_type_archive ()) {
0 commit comments