Skip to content

Instantly share code, notes, and snippets.

View Manoz's full-sized avatar
😏
Meh

Kévin Legrand Manoz

😏
Meh
View GitHub Profile
@Manoz
Manoz / dabblet.css
Created March 19, 2012 20:20
Font Face "hack"
/**
* Font Face "hack"
*/
@font-face {
font-family: "font-name";
src: url("../fonts/font-name.eot");
src: local("☺"),
url("../fonts/font-name.woff") format("woff"),
url("../fonts/font-name.otf") format("opentype"),
@Manoz
Manoz / index.html
Created June 24, 2013 20:37
A CodePen by Manoz.
<button>Normal button</button>
@Manoz
Manoz / gist:6096453
Created July 27, 2013 21:59
Fixed header on scroll
$(window).scroll(function() {
if ($(this).scrollTop() > 80) {
$('.fixed-header').addClass('fixed');
} else {
$('.fixed-header').removeClass('fixed');
}
});
<?php
$key = get_post_meta( get_the_ID(), 'wpsb_meta_box_check', true );
if( ! empty( $key ) ) {
echo $key;
}
?>
$key = get_post_meta( get_the_ID(), 'wpsb_meta_box_check', true );
if( $key == 'on' ) {
echo 'prout';
}
@Manoz
Manoz / gist:8181426
Created December 30, 2013 12:13
Wordpress snippet for meta_values
<?php
$key = get_post_meta( get_the_ID(), 'wpsb_meta_box_check', true );
if( $key == 'on' ) {
echo 'prout';
}
?>
@Manoz
Manoz / content-single-full.php
Last active January 1, 2016 18:09
Wordpress full-width post width get_post_meta() and 'add_meta_boxes'. Works with my css grid system. Screenshot : http://i.imgur.com/CgTaLuH.png
<?php while (have_posts()) : the_post(); ?>
<div class="main-content col-1-1">
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
Your single post content
</article>
</div>
<?php endwhile; ?>
@Manoz
Manoz / content.php
Created December 30, 2013 14:24
Better WordPress sticky post. Screenshot: http://imgur.com/NC54e38
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php
if ( is_sticky() ) {
echo '<div class="sticky-flag"><i class="icon-pin wiggle"></i></div>';
}
?>
<div class="post-thumbnail">
</div>
@Manoz
Manoz / functions.php
Last active January 1, 2016 22:19
À placer dans votre fichier functions.php
function wpc_widgets() {
remove_meta_box('dashboard_incoming_links', 'dashboard', 'normal');
remove_meta_box('dashboard_plugins', 'dashboard', 'normal');
remove_meta_box('dashboard_primary', 'dashboard', 'normal');
remove_meta_box('dashboard_secondary', 'dashboard', 'normal');
}
add_action('admin_init', 'wpc_widgets');
@Manoz
Manoz / clean.php
Created January 6, 2014 13:32
clean.php for WordPress. Clean wp_head() and other stuff like dashboard widgets.
<?php
/**
* Clean wp_head()
*
* Remove feed links
* Remove extra feed links
* Remove RSD & Windows Live Writer links
* Remove WP version
* Remove nav links
*/