Skip to content

Instantly share code, notes, and snippets.

View Reigard's full-sized avatar
🏠
Working from home

Alex Reigard

🏠
Working from home
View GitHub Profile
@Reigard
Reigard / CSS | Dialog animation
Created November 19, 2016 19:54
MagnificPopup Dialog Animation
.my-mfp-zoom-in .dialog {
opacity: 0;
-webkit-transition: all 0.2s ease-in-out;
-moz-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
-webkit-transform: scale(0.8);
-moz-transform: scale(0.8);
-ms-transform: scale(0.8);
-o-transform: scale(0.8);
@Reigard
Reigard / Wordpress template URL
Created October 5, 2016 20:22
PHP | Wordpress template URL
<?php echo get_template_directory_uri(); ?>
@Reigard
Reigard / Transform
Created August 5, 2016 13:44
SASS | Transform
// generic transform
@mixin transform($transforms) {
-moz-transform: $transforms;
-o-transform: $transforms;
-ms-transform: $transforms;
-webkit-transform: $transforms;
transform: $transforms;
}
// rotate
@mixin rotate ($deg) {
@Reigard
Reigard / Box shadow
Created August 4, 2016 18:12
SASS | Box-shadow
@mixin box-shadow($top, $left, $blur, $color, $inset: false) {
@if $inset {
-webkit-box-shadow:inset $top $left $blur $color;
-moz-box-shadow:inset $top $left $blur $color;
box-shadow:inset $top $left $blur $color;
} @else {
-webkit-box-shadow: $top $left $blur $color;
-moz-box-shadow: $top $left $blur $color;
box-shadow: $top $left $blur $color;
}
@Reigard
Reigard / E-mail AJAX Send + SweetAlert Plugin
Created August 3, 2016 08:27
jQuery | E-mail AJAX Send + SweetAlert Plugin
$("form").submit(function() {
var th = $(this);
$.ajax({
type: "POST",
url: temp_url + "/mail.php",
data: th.serialize()
}).done(function() {
swal("Letter is sent!", "Wait for answer!", "success");
});
return false;
@Reigard
Reigard / Default functions in WordPress
Created August 1, 2016 05:15
PHP | Default functions in WordPress
<?php
/*header clear*/
remove_action( 'wp_head', 'rsd_link' );
remove_action( 'wp_head', 'wlwmanifest_link' );
remove_action( 'wp_head', 'wp_shortlink_wp_head', 10, 0 );
remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );
remove_action( 'wp_head', 'wp_generator' );
remove_action( 'wp_head', 'feed_links_extra', 3 );
/*disable admin bar*/
@Reigard
Reigard / Header and footer
Created August 1, 2016 05:12
PHP | Header and footer
@Reigard
Reigard / Transition
Created July 31, 2016 16:14
SASS | Transition
@mixin transition($transition...) {
-moz-transition: $transition;
-o-transition: $transition;
-webkit-transition: $transition;
transition: $transition;
}
@mixin transition-property($property...) {
-moz-transition-property: $property;
-o-transition-property: $property;
-webkit-transition-property: $property;
@Reigard
Reigard / Chrome smooth scroll
Last active July 31, 2016 06:01
jQuery | Chrome smooth scroll
try {
$.browserSelector();
if($("html").hasClass("chrome")) {
$.smoothScroll();
}
} catch(err) {
};
@Reigard
Reigard / Cycle of posts
Created July 31, 2016 05:54
PHP | Cycle of posts
<?php $idObj = get_category_by_slug('cat_slug');
$id = $idObj->term_id;
$args = array('category' => $id, 'posts_per_page' => 10);
$lastposts = get_posts( $args );
foreach( $lastposts as $post ){ setup_postdata($post);
?>
<?php the_title(); ?>
<?php the_content(); ?>