Skip to content

Instantly share code, notes, and snippets.

View jfeliweb's full-sized avatar
🖖
Love, Peace and Happiness

Jean Felisme jfeliweb

🖖
Love, Peace and Happiness
View GitHub Profile
@jfeliweb
jfeliweb / function.php
Created May 6, 2015 21:14
Sticky conflict between WordPress and Zurb Foundation
// Stop WordPress from using the sticky class (which conflicts with Foundation), and style WordPress sticky posts using the .wp-sticky class instead
function remove_sticky_class($classes) {
$classes = array_diff($classes, array("sticky"));
$classes[] = 'wp-sticky';
return $classes;
}
add_filter('post_class','remove_sticky_class');
@jfeliweb
jfeliweb / header
Created May 1, 2015 05:26
Dual Header
<?php
if ( is_home() ) :
get_header( 'home' );
else :
get_header();
endif;
?>
@jfeliweb
jfeliweb / livechat.html
Last active August 29, 2015 14:17 — forked from soe/livechat.html
<html>
<body>
<!-- live chat button -->
<a id="liveagent_button_online_573i00000004DD7" href="javascript://Chat" style="display: none;" onclick="liveagent.startChat('573i00000004DD7')">
Online Chat
</a>
<div id="liveagent_button_offline_573i00000004DD7" style="display: none;">
Offline Chat
</div>
<?php
add_action('wp_head', 'admin_bar_fix', 5);
function admin_bar_fix() {
if( !is_admin() && is_admin_bar_showing() ) {
remove_action( 'wp_head', '_admin_bar_bump_cb' );
$output = '<style type="text/css">'."\n\t";
//$output .= 'body.admin-bar { padding-top: 28px; }'."\n";
$output .= 'body.admin-bar .top-bar { margin-top: 28px; }'."\n";
@jfeliweb
jfeliweb / function-ie7.php
Last active August 29, 2015 14:15
Add Font Awesome CDN & Support IE7
<?php
/**
* Registers and loads font awesome
* CSS files using a CDN.
*
* @link http://www.bootstrapcdn.com/#tab_fontawesome
* @author FAT Media
*/
add_action( 'wp_enqueue_scripts', 'prefix_enqueue_awesome' );
/**
@jfeliweb
jfeliweb / style
Created February 3, 2015 16:33
Basic Sticky Post Styling
/*regular sticky post*/
.sticky {
background: #FAFAFA;
border: 3px solid #E6E6E6;
padding: 15px;
}
/*Catogary Sticky Post*/
.category-sticky {
background: #FAFAFA;
@jfeliweb
jfeliweb / style
Created February 3, 2015 16:19
Base Comment Thread
ol.commentlist { list-style:none; margin:0 0 1em; padding:0; text-indent:0; }
ol.commentlist li { }
ol.commentlist li.alt { }
ol.commentlist li.bypostauthor {}
ol.commentlist li.byuser {}
ol.commentlist li.comment-author-admin {}
ol.commentlist li.comment { border-bottom:1px dotted #666; padding:1em; }
ol.commentlist li.comment div.comment-author {}
ol.commentlist li.comment div.vcard { font:normal 16px georgia,times,serif; }
ol.commentlist li.comment div.vcard cite.fn { font-style:normal; }
@jfeliweb
jfeliweb / loop single
Last active August 29, 2015 14:14
“Edit This” Button on Posts and Pages
// basic
<?php edit_post_link('✍','',' '); ?>
// add image
<?php edit_post_link('images/edit.png','',' '); ?>
// before title tage
<h1><?php edit_post_link('✍','',' '); ?> <?php the_title() ?></h1>
// source: http://digwp.com/2011/06/fun-edit-posts-link/
@jfeliweb
jfeliweb / function
Last active August 29, 2015 14:14
Github Gist oEmbed
// [gist id="ID" file="FILE"]
function gist_shortcode($atts) {
return sprintf(
'<script src="https://gist.github.com/%s.js%s"></script>',
$atts['id'],
$atts['file'] ? '?file=' . $atts['file'] : ''
);
}
add_shortcode('gist','gist_shortcode');
@jfeliweb
jfeliweb / loop
Created January 30, 2015 03:09
ADD GRAVATARS FOR THE POST AUTHOR
/*****
Pretty simple, huh? get_the_author_email
outputs the post author’s email and
the “80” is the size of the avatar image
in pixels (you can change that).
How this will look depends on how you use it;
where you put it in the theme (it has to be in the loop!)
and how you style it.
*****/