Skip to content

Instantly share code, notes, and snippets.

@malachi358
malachi358 / gist:6077473
Created July 25, 2013 07:05
CSS Fade In Animation
.fade-in {
animation: fadein 4s;
-moz-animation: fadein 4s; /* Firefox */
-webkit-animation: fadein 4s; /* Safari and Chrome */
-o-animation: fadein 4s; /* Opera */
}
@keyframes fadein {
from {
opacity:0;
}
<script type="text/javascript">
jQuery(document).ready(function ($) {
$('.product_grid_item:nth-child(19)').after('<div class="mid-header" id="hp1" ><div id="votk"><p>1</p></div> <h1 class="entry-title"><?php the_title(); ?> </h1></div>');
$('.product_grid_item:nth-child(40)').after('<div class="mid-header" id="hp2" ><div id="votk"><p>2</p></div> <h1 class="entry-title"><?php the_title(); ?> </h1></div>');
$('.product_grid_item:nth-child(61)').after('<div class="mid-header" id="hp3"><div id="votk"><p>3</p></div> <h1 class="entry-title"><?php the_title(); ?> </h1></div>');
$('.product_grid_item:nth-child(82)').after('<div class="mid-header" id="hp4"><div id="votk"><p>4</p></div> <h1 class="entry-title"><?php the_title(); ?> </h1></div>');
@malachi358
malachi358 / gist:6807737
Last active December 24, 2015 13:49
Bottom Border Image http://border-image.com/
border-style: solid;
border-width: 27px;
-moz-border-image: url(http://www.w3.org/TR/css3-background/border.png) 27 repeat;
-webkit-border-image: url(http://www.w3.org/TR/css3-background/border.png) 27 repeat;
-o-border-image: url(http://www.w3.org/TR/css3-background/border.png) 27 repeat;
border-image: url(http://www.w3.org/TR/css3-background/border.png) 27 fill repeat;
@malachi358
malachi358 / gist:7147761
Created October 25, 2013 00:51
Jquery Function to change style
$('.btnName').click(function() {
top.$('#panel').toggle(function() {
$(this).animate({
// style change
}, 500);
},
function() {
$(this).animate({
// style change back
}, 500);
@malachi358
malachi358 / gist:7427078
Created November 12, 2013 07:42
Wordpress Menu Limit Fix for Inmotion Hosting
add this to the htaccess file
<IfModule mod_php5.c>
php_value max_input_vars 5000
</IfModule>
@malachi358
malachi358 / gist:7478540
Created November 15, 2013 03:15
Jquery Switch class on Scroll!
$(function() {
var header = $(".clearHeader");
$(window).scroll(function() {
var scroll = $(window).scrollTop();
if (scroll >= 500) {
header.removeClass('clearHeader').addClass("darkHeader");
} else {
header.removeClass("darkHeader").addClass('clearHeader');
}
@malachi358
malachi358 / gist:7641155
Created November 25, 2013 13:27
Ajax Update Cart Items(Mini Cart) via function.php for WPEC
/**
* add a custom AJAX request handler
*/
function theme_wpsc_cart_update() {
$data = array(
'cart_count' => wpsc_cart_item_count(),
'cart_total' => wpsc_cart_total_widget(),
);
echo json_encode($data);
exit;
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS responsive images</title>
<style>
/* Doesn't stop original source image being
downloaded too */
@media (min-device-width:600px) {
@malachi358
malachi358 / gist:8de1e42ae4bbdffaeb32
Created July 12, 2014 18:15
WP User Information
<?php
$current_user = wp_get_current_user();
/**
* @example Safe usage: $current_user = wp_get_current_user();
* if ( !($current_user instanceof WP_User) )
* return;
*/
echo 'Username: ' . $current_user->user_login . '<br />';
echo 'User email: ' . $current_user->user_email . '<br />';
echo 'User first name: ' . $current_user->user_firstname . '<br />';
@malachi358
malachi358 / gist:efb708532f7c60bd0647
Created July 15, 2014 18:59
Hide one element when another one is present
$pc(document).ready(function(){
if($pc('#modalSignup').length){
$pc('.account-info').hide();
}
});