projects
/
WP-Themes
/
charemisd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7576026
)
adding is_tree function for the separate menu locations
author
Anthony Talarico
<talarico@gaslightmedia.com>
Thu, 9 Aug 2018 17:43:32 +0000
(13:43 -0400)
committer
Anthony Talarico
<talarico@gaslightmedia.com>
Thu, 9 Aug 2018 17:43:32 +0000
(13:43 -0400)
functions.php
patch
|
blob
|
history
diff --git
a/functions.php
b/functions.php
index
ea71f68
..
c1b7f56
100644
(file)
--- a/
functions.php
+++ b/
functions.php
@@
-180,7
+180,20
@@
function mytheme_search_loop() {
<?php endwhile;
}
+function is_tree( $pid ) {
+ global $post;
+ if ( is_page($pid) )
+ return true;
+
+ $anc = get_post_ancestors( $post->ID );
+ foreach ( $anc as $ancestor ) {
+ if( is_page() && $ancestor == $pid ) {
+ return true;
+ }
+ }
+ return false;
+}
function is_post_type($type){
global $wp_query;
if($type == get_post_type($wp_query->post->ID)) return true;