Skip to content

Instantly share code, notes, and snippets.

// debulked onresize handler
function on_resize(c,t){onresize=function(){clearTimeout(t);t=setTimeout(c,100)};return c};
on_resize(function() {
$('.encadres_item span').each(function() {
var $img = $(this);
var h = $img.height();
$img.css('margin-top', + h / -2 + "px");
});
})();
@oblik
oblik / Animation panier
Created October 23, 2013 13:47
Animation panier
// Check if the block cart is activated for the animation
if (cartBlockOffset != undefined && $picture.size())
{
$picture.appendTo('body');
$picture.css({ 'position': 'absolute', 'top': $picture.css('top'), 'left': $picture.css('left'), 'z-index': 4242 })
.animate({ 'width': '20px', 'height': '20px', 'opacity': 0.8, 'top': cartBlockOffset.top + 20, 'left': cartBlockOffset.left + 20 }, 2000,'easeInOutQuart',function(){
$('.ajax_cart_quantity').animate({opacity:0},200,"linear",function(){ $(this).animate({opacity:1},2000);});
$('#popup').bPopup({
easing: 'easeOutBack', //uses jQuery easing plugin
speed: 450,
@oblik
oblik / Plugins jquery
Created October 21, 2013 14:28
Plugins jquery
Caroussel responsive : http://www.owlgraphic.com/owlcarousel/
Meme hauteur pour chaque div : http://tsvensen.github.io/equalize.js/
Voir d'un reseau externe :
http://www.pici.picidae.net/
@oblik
oblik / CSS img responsive.css
Created September 23, 2013 09:33
CSS img responsive
img {
max-width: 100%;
height: auto;
width: auto; /* bug ie8 */
box-sizing: border-box;
}
@oblik
oblik / Categories checkbox on top prevent on edit
Created July 10, 2013 12:15
Catégories checkbox - garde la hiérarchie des catégories
// Categories checkbox on top prevent on edit ____________________________________
function taxonomy_checklist_checked_ontop_filter ($args) {
$args['checked_ontop'] = false;
return $args;
}
add_filter('wp_terms_checklist_args','taxonomy_checklist_checked_ontop_filter');
@oblik
oblik / display current post taxonomies and terms
Created July 8, 2013 15:04
display current post taxonomies and terms
function custom_taxonomies_terms_links() {
global $post, $post_id;
// get post by post id
$post = &get_post($post->ID);
// get post type by post
$post_type = $post->post_type;
// get post type taxonomies
$taxonomies = get_object_taxonomies($post_type);
$out = "<ul>";
foreach ($taxonomies as $taxonomy) {
<?php
global $post;
$text = get_post_meta( $post->ID, '_cmb_test_text', true );
echo $text;
?>
@oblik
oblik / Custom Queries
Created July 8, 2013 06:59
Custom Queries
<section class="home_blog">
<h2>Derni&egrave;re actualit&eacute;</h2>
<?php $query = new WP_Query( array(
'post_type' => 'post',
'orderby' => 'date',
'posts_per_page' => 1
) );
while ($query->have_posts()) : $query->the_post();
$thumb = get_post_thumbnail_id();
if ( function_exists('has_post_thumbnail') && has_post_thumbnail() ) {