Skip to content

Instantly share code, notes, and snippets.

View willfaang's full-sized avatar

Will Fang willfaang

View GitHub Profile
@willfaang
willfaang / index.php
Created June 9, 2017 13:38
PHP Cookies - Set user cookie for client's browser.
<?php
$cookie_name = "username";
$cookie_value = "devuser";
setcookie($cookie_name, $cookie_value, time()+3600);
?>
<!DOCTYPE html>
<html>
<head>
@willfaang
willfaang / header.php
Created April 17, 2017 18:30
Push header content down when logged into wp-admin
<header id="wrap-head" class="header <?php if ( is_user_logged_in() && is_admin_bar_showing() ) { echo 'logged-in'; } ?>">
</header>
@willfaang
willfaang / index.php
Created March 9, 2017 20:45
Sample Slider Loop For Wordpress
<div class="featurewrap">
<div class="feature">
<?php
$args = array(
'post_type' => 'post',
'tag' => 'blog'
);
$quote_query = new WP_Query($args); ?>
<div class="carousel testimonials slide-group-1" data-transition="fade" data-interval="9000">
@willfaang
willfaang / index.html
Created March 3, 2017 17:49
Angular2 Preload Spinner Screen
<app-root>
<style type="text/css">
#pre-load {
background-color: #484848;
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 999999;
@willfaang
willfaang / sort.js
Created August 4, 2016 05:03
JS Array Object Sort
var people=[]
people[0]={name:"Will", age:31}
people[1]={name:"Edward", age:17}
people[2]={name:"Christine", age:58}
people[3]={name:"George", age:62}
people.sort(function(a, b){
return a.age-b.age
}