Skip to content

Instantly share code, notes, and snippets.

View srikat's full-sized avatar

Sridhar Katakam srikat

View GitHub Profile
//* Remove the default header
remove_action( 'genesis_header', 'genesis_do_header' );
//* Add custom header
add_action( 'genesis_header', 'sk_do_header' );
function sk_do_header() {
echo '<div class="my-header-image"><a href="http://genesis.dev/"><img src="http://genesis.dev/wp-content/uploads/2014/01/header.jpg" /></a></div>';
genesis_markup( array(
@srikat
srikat / gist:8702363
Last active August 29, 2015 13:55
Using ScrollReveal.js to fade in posts in Genesis. http://sridharkatakam.com/using-scrollreveal-js-fade-posts-genesis/
//* Enqueue ScrollReveal.js
add_action( 'wp_enqueue_scripts', 'enqueue_scrollreveal' );
function enqueue_scrollreveal() {
wp_enqueue_script( 'scrollreveal', get_stylesheet_directory_uri() . '/js/scrollReveal.min.js', array( 'jquery' ), '', true );
}
@srikat
srikat / functions.php
Last active August 29, 2015 13:55
Banner image below header in eleven40 Pro. http://sridharkatakam.com/add-image-header-eleven40-pro/
add_action( 'genesis_after_header', 'sk_show_banner_below_header' );
function sk_show_banner_below_header() {
echo '<div class="banner-below-header">
<div class="wrap">
<img src="http://genesis.dev/wp-content/uploads/2014/01/header-1140x200.jpg" alt="my banner" />
</div>
</div>';
}
@srikat
srikat / functions.php
Last active August 29, 2015 13:55
Adding double border around the container in Focus Pro. http://sridharkatakam.com/add-double-border-around-container-focus-pro/
//* Add div.wrap1 and div.wrap2 inside .site-container
add_action( 'genesis_before_header', 'sk_add_wraps_opening_divs', 9 );
function sk_add_wraps_opening_divs() {
echo '<div class="wrap1"><div class="wrap2">';
}
add_action( 'genesis_after_footer', 'sk_add_wraps_closing_divs' );
function sk_add_wraps_closing_divs() {
//* Enqueue FitVids
add_action( 'wp_enqueue_scripts', 'enqueue_fitvids' );
function enqueue_fitvids() {
wp_enqueue_script( 'fitvids', get_bloginfo('url') . '/wp-content/js/jquery.fitvids.js', array( 'jquery' ), '', true );
wp_enqueue_script( 'fitvids-init', get_bloginfo('url') . '/wp-content/js/jquery.fitvids.init.js', array( 'fitvids' ), '1.0.0', true );
}
wp_enqueue_style( 'animate', get_stylesheet_directory_uri() . '/css/animate.min.css' );
// load Waypoints
// Source: http://imakewebthings.com/jquery-waypoints/
wp_enqueue_script( 'waypoints', get_stylesheet_directory_uri() . '/js/waypoints.min.js', array( 'jquery' ), '1.0.0' );
wp_enqueue_script( 'waypoints-init', get_stylesheet_directory_uri() .'/js/waypoints-init.js' , array( 'jquery', 'waypoints' ), '1.0.0' );
@srikat
srikat / functions.php
Created February 5, 2014 14:05
Adding 'Last updated on: date' to post info in Genesis
//* Add last updated date to the post info in entry header (requires HTML5 theme support)
add_filter( 'genesis_post_info', 'sk_post_info_filter' );
function sk_post_info_filter($post_info) {
if (get_the_modified_time() != get_the_time()) {
$post_info = $post_info . '<br/>Last updated on: ' . the_modified_date('F j, Y', '', '', false);
}
return $post_info;
}
//* Reposition the secondary navigation menu
add_action( 'genesis_meta', 'sk_reposition_subnav' );
function sk_reposition_subnav() {
if( ! is_front_page() )
return;
remove_action( 'genesis_after_header', 'genesis_do_subnav' );
add_action ( 'genesis_before_footer', 'genesis_do_subnav', 1 );
@srikat
srikat / functions.php
Last active August 29, 2015 13:56
Using a 500x60 logo header image in Agency Pro. http://sridharkatakam.com/use-500x60-logo-header-image-agency-pro/
//* Remove the default header
remove_action( 'genesis_header', 'genesis_do_header' );
//* Add custom header
add_action( 'genesis_header', 'sk_do_header' );
function sk_do_header() {
echo '<a href="http://genesis.dev/"><img src="http://genesis.dev/wp-content/uploads/2014/02/500x60.gif" /></a>';
genesis_markup( array(
@srikat
srikat / functions.php
Last active August 29, 2015 13:56
Changing responsive menu icon from hamburger to a custom one in Genesis. Screenshot: http://i.imgur.com/27i9vFN.png. "content" codes can be obtained from http://melchoyce.github.io/dashicons/.
//* Enqueue Dashicons
add_action( 'wp_enqueue_scripts', 'dashicons' );
function dashicons() {
wp_enqueue_style( 'themename-style', get_stylesheet_uri(), array( 'dashicons' ), '1.0' );
}