This file contains 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 compareArrays(sup, sub) { | |
sup.sort(); | |
sub.sort(); | |
var i, j; | |
for (i=0,j=0; i<sup.length && j<sub.length;) { | |
if (sup[i] < sub[j]) { | |
++i; | |
} else if (sup[i] == sub[j]) { | |
++i; ++j; | |
} else { |
This file contains 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
[wpv-if fieldname="wpcf-fieldname" evaluate="empty(fieldname)" condition="false"][/wpv-if] |
This file contains 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
<?php | |
$category = get_queried_object(); | |
echo $category->term_id; | |
?> |
This file contains 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
<?php | |
$arr = array( new stdClass(), new stdClass() ); | |
$arr[0]->colour = 'red'; | |
$arr[1]->colour = 'green'; | |
$arr[1]->state = 'enabled'; | |
if (in_array_field('red', 'colour', $arr)) | |
echo 'Item exists with colour red.'; | |
if (in_array_field('magenta', 'colour', $arr)) |
This file contains 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
// RELOADS WEBPAGE WHEN MOBILE ORIENTATION CHANGES | |
window.onorientationchange = function() { | |
var orientation = window.orientation; | |
switch(orientation) { | |
case 0: window.location.reload(); | |
break; | |
case 90: window.location.reload(); | |
break; | |
case -90: window.location.reload(); | |
break; |
This file contains 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
var list = $('ul'); | |
var listItems = list.children('li'); | |
list.append(listItems.get().reverse()); |
This file contains 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
/* --- comments --- */ | |
.commentlist { | |
margin-left: 0; | |
} | |
#comments { | |
padding-top: 20px; | |
} |
This file contains 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
<h1>Heading 1</h1> | |
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam et mattis nulla. Quisque volutpat arcu et accumsan tincidunt <strong>this is bold</strong>. <em>This is italic</em> Cras non lorem dui. Aenean quis erat mi. Sed metus ligula, varius quis lacinia at, rhoncus in est. Donec <a href="http://www.google.com">this is a link</a>. Fusce facilisis, nisi sed egestas euismod, tortor turpis tincidunt leo, sit amet aliquet nulla elit in nulla. Mauris dapibus varius quam eget interdum. Maecenas libero purus, egestas et interdum nec, semper in nulla. Curabitur a neque posuere, ullamcorper nibh vel, vestibulum libero. Maecenas commodo ipsum id risus euismod, ut mollis massa posuere. In eget vestibulum dolor, vel scelerisque magna. Nulla non sapien eu elit posuere hendrerit. | |
<h2>Heading 2</h2> | |
<h3>Heading 3</h3> | |
<h4>Heading 4</h4> | |
<h5>Heading 5</h5> | |
<h6>Heading 6</h6> | |
<img class="alignright" src="https://placeimg.com/300/400/any" alt="" width="300" height="400" />Ut in nisl ligula. Vivamus et d |
This file contains 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 fixHeight() { | |
var maxHeight = 0, | |
slides = el.find('.slides'), | |
data = el.data('flexslider'); | |
slides.children() | |
.height('auto') | |
.each(function() { | |
maxHeight = Math.max(maxHeight, $(this).height()); | |
}) | |
.height(maxHeight); |