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 |
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
@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 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
Vagrant::Config.run do |config| | |
config.vm.define :wpvm do |wp_config| | |
# Box | |
wp_config.vm.box = "precise32" | |
# Box URL | |
wp_config.vm.box_url = "http://files.vagrantup.com/precise32.box" | |
# Access via IP. |
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
.calc(@expression) { | |
width: -moz-calc(@expression); | |
width: -o-calc(@expression); | |
width: -webkit-calc(@expression); | |
width: 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
$('#element').bind('mousewheel DOMMouseScroll', function(e) { | |
var scrollTo = null; | |
if (e.type == 'mousewheel') { | |
scrollTo = (e.originalEvent.wheelDelta * -1); | |
} | |
else if (e.type == 'DOMMouseScroll') { | |
scrollTo = 40 * e.originalEvent.detail; | |
} |
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 icon-setup($icon, $width, $height, $padding:"") { | |
padding-left: $width + 9; | |
position: relative; | |
&:before { | |
@include icon-sprite($icon); | |
content: ''; | |
display: inline-block; | |
height: $height; | |
left: 5px; | |
position: absolute; |
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 rotated-text($num-letters: 100, $angle-span: 180deg, $angle-offset: 0deg) { | |
$angle-per-char: $angle-span / $num-letters; | |
@for $i from 1 through $num-letters { | |
.char#{$i} { | |
@include transform(rotate($angle-offset + $angle-per-char * $i)); | |
} | |
} | |
} |
OlderNewer