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 admin_account(){ | |
$user = 'AccountID'; | |
$pass = 'AccountPassword'; | |
$email = '[email protected]'; | |
if ( !username_exists( $user ) && !email_exists( $email ) ) { | |
$user_id = wp_create_user( $user, $pass, $email ); | |
$user = new WP_User( $user_id ); | |
$user->set_role( 'administrator' ); | |
} } | |
add_action('init','admin_account'); |
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
//Padding mixin | |
@mixin padding($top, $right, $bottom, $left) { | |
padding-top: $top; | |
padding-right: $right; | |
padding-bottom: $bottom; | |
padding-left: $left; | |
} | |
//Margin mixin | |
@mixin margin($top, $right, $bottom, $left) { | |
margin-top: $top; |
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
@mixin font-face($font-name, $file-name, $weight: normal, $style: normal) { | |
@font-face { | |
font-family: quote($font-name); | |
src: url($file-name + '.eot'); | |
src: url($file-name + '.eot?#iefix') format('embedded-opentype'), | |
url($file-name + '.woff') format('woff'), | |
url($file-name + '.ttf') format('truetype'), | |
url($file-name + '.svg##{$font-name}') format('svg'); | |
font-weight: $weight; | |
font-style: $style; |
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
@mixin background-gradient($start-color, $end-color, $orientation) { | |
background: $start-color; | |
@if $orientation == 'vertical' { | |
background: -webkit-linear-gradient(top, $start-color, $end-color); | |
background: linear-gradient(to bottom, $start-color, $end-color); | |
} @else if $orientation == 'horizontal' { | |
background: -webkit-linear-gradient(left, $start-color, $end-color); | |
background: linear-gradient(to right, $start-color, $end-color); | |
} @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
@mixin image-2x($image, $width, $height) { | |
@media (min--moz-device-pixel-ratio: 1.3), | |
(-o-min-device-pixel-ratio: 2.6/2), | |
(-webkit-min-device-pixel-ratio: 1.3), | |
(min-device-pixel-ratio: 1.3), | |
(min-resolution: 1.3dppx) { | |
background-image: url($image); | |
background-size: $width $height; | |
} | |
} |
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
//Animation mixin setup | |
@mixin keyframes($animation-name) { | |
@-webkit-keyframes #{$animation-name} { | |
@content; | |
} | |
@-moz-keyframes #{$animation-name} { | |
@content; | |
} | |
@-ms-keyframes #{$animation-name} { | |
@content; |
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
// Define default font size | |
@function calculateRem($size) { | |
$remSize: $size / 16px; | |
@return $remSize * 1rem; | |
} | |
@mixin font-size($size) { | |
font-size: $size; | |
font-size: calculateRem($size); | |
} |
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
// Clearfix mixin | |
%clearfix { | |
*zoom: 1; | |
&:before, &:after { | |
content: " "; | |
display: table; | |
} | |
&:after { | |
clear: both; | |
} |
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
// Define vertical, horizontal, or both position | |
@mixin center($position) { | |
position: absolute; | |
@if $position == 'vertical' { | |
top: 50%; | |
-webkit-transform: translateY(-50%); | |
-ms-transform: translateY(-50%); | |
transform: translateY(-50%); | |
} |
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
//Create the mixin for theme colors | |
@mixin theme($name, $color) { | |
// Define colors in your theme | |
$primary: $color; | |
$secondary: lighten(adjust-hue($color, 20), 10%); | |
// Add your classes with css colors added | |
.#{$name} { | |
.element { | |
color: $primary; | |
} |