Skip to content

Instantly share code, notes, and snippets.

@10h30
10h30 / functions.php
Last active August 29, 2015 14:19 — forked from About2git/functions.php
How to Slide Down Search Box in a Full Screen Overlay in Genesis https://sridharkatakam.com/slide-search-box-full-screen-overlay-genesis/
<?php
//* Do NOT include the opening php tag
//* https://sridharkatakam.com/slide-search-box-full-screen-overlay-genesis/
//* Make Font Awesome available
add_action( 'wp_enqueue_scripts', 'enqueue_font_awesome' );
function enqueue_font_awesome() {
wp_enqueue_style( 'font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css' );
}
@10h30
10h30 / functions.php
Last active August 29, 2015 14:19 — forked from srikat/functions.php
Display Archive pages by Modified Date in WordPress
add_action( 'pre_get_posts', 'sk_order_posts_by_modified' );
/**
* Arrange Posts by last modified with the most recently updated ones at the top
*
* @author Sridhar Katakam
* @author Bill Erickson <- Boss
* @link http://www.billerickson.net/customize-the-wordpress-query/
* @param object $query data
*
*/
@10h30
10h30 / backstretch-set.js
Last active March 7, 2017 09:26 — forked from srikat/backstretch-set.js
Set Featured Image as Header's background using Backstretch in Genesis
jQuery(function( $ ){
$(".site-header").backstretch([BackStretchImg.src],{duration:3000,fade:750});
});
@10h30
10h30 / functions.php
Created April 16, 2015 01:07 — forked from srikat/functions.php
Revealing Featured Images when hovering on Posts in Whitespace Pro. http://sridharkatakam.com/reveal-featured-images-hovering-posts-whitespace-pro/
add_image_size( 'home-image', 400, 400, true );
@10h30
10h30 / archive-portfolio.php
Last active August 29, 2015 14:19 — forked from srikat/archive-portfolio.php
Portfolio in Genesis with Featured Images in a Grid revealing Title and Excerpt on Hover. http://sridharkatakam.com/portfolio-genesis-featured-images-grid-revealing-title-excerpt-hover/
<?php
/**
* Portfolio Archive
* Author: Sridhar Katakam
*
*/
//* Add portfolio body class to the head
add_filter( 'body_class', 'sk_add_portfolio_body_class' );
function sk_add_portfolio_body_class( $classes ) {
@10h30
10h30 / functions.php
Last active August 29, 2015 14:19 — forked from srikat/functions.php
Showing a different menu in Primary Navigation location conditionally in Genesis
<?php
//* Do NOT include the opening php tag
add_action( 'genesis_before', 'sk_replace_menu_in_primary' );
/**
* Conditionally replace Custom Menu in Primary Navigation.
*
* @author Sridhar Katakam
* @link http://sridharkatakam.com/conditionally-replace-navigation-menu-genesis/
*/
@10h30
10h30 / functions.php
Last active February 3, 2017 00:40 — forked from srikat/functions.php
How to set up animated Search form in Genesis. http://sridharkatakam.com/set-animated-search-form-genesis/
//* Enqueue scripts and styles
add_action( 'wp_enqueue_scripts', 'custom_enqueue_scripts_styles' );
function custom_enqueue_scripts_styles() {
wp_enqueue_style( 'font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css' );
wp_enqueue_script( 'global', get_bloginfo( 'stylesheet_directory' ) . '/js/global.js', array( 'jquery' ), '1.0.0', true );
}
@10h30
10h30 / genesis-masonry.php
Last active August 29, 2015 14:19 — forked from srikat/genesis-masonry.php
Pinterest-like Masonry layout for Posts page and Archives in Genesis. Details: http://sridharkatakam.com/using-masonry-genesis-pinterest-like-layout/
<?php
//* Do NOT include the opening php tag
// =================================================================
// = Pinterest-like Masonry layout for Posts page and Archives =
// =================================================================
//* Enqueue and initialize jQuery Masonry script
function sk_masonry_script() {
if (is_home() || is_archive()) {
<?php
//* Do NOT include the opening php tag
add_action( 'pre_get_posts', 'sk_change_blog_home_posts_per_page' );
/**
* Change Posts Per Page for Blog Home
*
* @author Bill Erickson (original), changed by Sridhar Katakam
* @link http://www.billerickson.net/customize-the-wordpress-query/
* @param object $query data
@10h30
10h30 / functions.php
Last active August 29, 2015 14:19 — forked from srikat/functions.php
How to display Featured images above Posts with Title as overlay. http://sridharkatakam.com/display-featured-images-posts-title-overlay/
//* Register a custom image size for Featured images above entries on list pages
add_image_size( 'archive-featured-image', 800, 300, true );
add_action( 'genesis_before_entry', 'sk_featured_image_above_posts' );
/**
* Display Featured Image above Post Titles regardless of Content Archives settings
*
* Context: Posts page, all archives and search results pages.
*
* @author Sridhar Katakam