This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function is_tree( $pid ) { // $pid = The ID of the page we're looking for pages underneath | |
global $post; // load details about this page | |
if ( is_page($pid) ) | |
return true; // we're at the page or at a sub page | |
$anc = get_post_ancestors( $post->ID ); | |
foreach ( $anc as $ancestor ) { | |
if( is_page() && $ancestor == $pid ) { | |
return true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin calc($property, $expression) { | |
#{$property}: -moz-calc(#{$expression}); | |
#{$property}: -o-calc(#{$expression}); | |
#{$property}: -webkit-calc(#{$expression}); | |
#{$property}: calc(#{$expression}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function random_tax() { | |
$counter = 0; | |
$max = 5; // Set max number of items here. | |
$cats =''; | |
$categories=get_categories(); | |
$rand_keys = array_rand($categories, $max); | |
foreach ($rand_keys as $key) { | |
$cats .= $categories[$key]->term_id .','; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<li> | |
<?php if(!get_field("content_1") && (!get_field("content_2")): ?> | |
// Full width image code | |
<?php else: ?> | |
// Regular image code | |
<?php endif; ?> | |
</li> | |
&& - both things |
NewerOlder