View nav pipes
1 2 3 4 5 6 7 8 9 10
#site-navigation ul li:after {
content: '|';
color: #fff;
font-size: 10px;
line-height: 24px;
float: left;
}
 
#site-navigation ul li:last-child:after {
content: ' ';
View wordpress change category dropdown text
1 2 3 4 5
function ChangeSelectTitle($cat_args){
$cat_args['show_option_none'] = __('My Category');
return $cat_args;
}
add_filter('widget_categories_dropdown_args', 'ChangeSelectTitle');
View CSS
1 2 3 4 5 6 7 8 9 10
.thing {
float: left;
width: 50%;
margin: 10px 0;
box-sizing: border-box;
text-align: center;
background: #e0e0e0;
}
 
.thing--one {
View dynamic mobile menu
1 2 3 4 5 6 7 8 9 10
//function for showing/hiding mobile menu dynamically
function mobileMenuToggle(){
//get height of menu and auto-detect when it needs to switch to mobile version
var menuHeight = $('#site-navigation').height();
 
//menu pushed onto 2 lines, hide it and show mobile one
if((isMobile == false) && (menuHeight > 30)){ //EDIT THIS HEIGHT!
//get the current browser width, as once the browser is this width (or wider) again, normal menu will need to kick in.
$('#site-navigation').hide();
$('#mobile').show();
View gist:4fc8e575d82529a19dab
1 2 3
-webkit-appearance: none;
border-radius: 0;
-webkit-border-radius: 0;
View Placeholder text colour
1 2 3 4 5 6 7 8 9 10
::-webkit-input-placeholder {
color: red;
}
 
:-moz-placeholder { /* Firefox 18- */
color: red;
}
 
::-moz-placeholder { /* Firefox 19+ */
color: red;
View compare arrays
1 2 3 4 5 6 7 8 9 10
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 {
View gist:ebfb68cee0bc005d1892
1
[wpv-if fieldname="wpcf-fieldname" evaluate="empty(fieldname)" condition="false"][/wpv-if]
View gist:513bf64501a3bf16d70b
1 2 3 4 5 6 7
<?php
$category = get_queried_object();
echo $category->term_id;
?>
View gist:7661bd5bd36c5c158438
1 2 3 4 5 6 7 8 9 10
<?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))
Something went wrong with that request. Please try again.