Skip to content

Instantly share code, notes, and snippets.

View srikat's full-sized avatar

Sridhar Katakam srikat

View GitHub Profile
@srikat
srikat / style.css
Created September 28, 2013 12:49
style.css additions to make design changes in Sixteen Nine Pro Theme from StudioPress. Full details: http://sridharkatakam.com/move-left-section-top-sixteen-nine-pro-theme/
/*
Move left section (.site-header) to top
---------------------------------------------------------------------------------------------------- */
/* Custom styles by Sridhar Katakam */
.site-container {
max-width: none;
}
.site-header {
@srikat
srikat / functions.php
Created September 28, 2013 14:52
Add widget area after .menu in Genesis Primary Nav. Source: https://gist.github.com/NicktheGeek/4503511
//* Register widget area
genesis_register_sidebar( array(
'id' => 'nav-right',
'name' => __( 'Nav Right', 'genesis-sample' ),
'description' => __( 'This is after .menu in .nav-primary', 'genesis-sample' ),
) );
// Adds widget area after .menu in .nav-primary
add_filter( 'genesis_do_nav', 'sk_do_nav_widget', 10, 2 );
@srikat
srikat / functions.php
Created September 29, 2013 06:45
Adding a Featured area above posts when using Masonry in Genesis. http://sridharkatakam.com/adding-featured-area-posts-using-masonry-genesis/
<?php
//* Start the engine
include_once( get_template_directory() . '/lib/init.php' );
//* Child theme (do not remove)
define( 'CHILD_THEME_NAME', 'Genesis Sample Theme' );
define( 'CHILD_THEME_URL', 'http://www.studiopress.com/' );
define( 'CHILD_THEME_VERSION', '2.0.1' );
//* Enqueue Lato Google font
/*
Filterable Portfolio
---------------------------------------------------------------------------------------------------- */
ul.filter {
color: #999;
list-style: none;
margin-left: 0;
}
<?php
/**
* The custom portfolio post type archive template for a Filterable Portfolio
*/
# Force full width content
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
wp_enqueue_script('isotope', get_stylesheet_directory_uri() . '/js/jquery.isotope.min.js', array('jquery'), '1.5.25', true);
wp_enqueue_script('isotope_init', get_stylesheet_directory_uri() . '/js/isotope_init.js', array('isotope'), '', true);
<?php
/**
* Template Name: Filterable Portfolio
*
* By Sridhar Katakam (http://sridharkatakam.com) based on Adapt Theme (http://www.wpexplorer.com/adapt-free-responsive-wordpress-theme/)
*/
?>
<?php
@srikat
srikat / functions.php
Created October 5, 2013 06:56
Show Featured Image for Posts and Pages if present, otherwise show responsive slider in Genesis. Details: http://sridharkatakam.com/show-featured-image-present-otherwise-show-responsive-slider-genesis/
<?php
//* Do NOT include the opening php tag
/** Show Featured Image for Posts and Pages if present, otherwise show responsive slider */
genesis_register_sidebar( array(
'id' => 'home-slider',
'name' => __( 'Home Slider', 'eleven40' ),
'description' => __( 'This is the after header section.', 'eleven40' ),
) );
@srikat
srikat / functions.php
Last active December 24, 2015 18:29
Show full content for posts in category archive page of a specific category in Genesis. Details: http://sridharkatakam.com/display-full-content-category-pages-selected-categories-genesis/
<?php
add_action( 'genesis_before_loop', 'sk_full_content_specific_category' );
function sk_full_content_specific_category() {
if (is_category('featured')) {
// remove_action( 'genesis_post_content', 'genesis_do_post_content' ); /* Pre-HTML5 */
remove_action( 'genesis_entry_content', 'genesis_do_post_content' ); /* HTML5 */
// add_action( 'genesis_post_content', 'sk_do_post_content' ); /* Pre-HTML5 */
<?php
add_action( 'genesis_before_loop', 'sk_full_content_specific_category' );
function sk_full_content_specific_category() {
if (is_category('featured')) {
// remove_action( 'genesis_post_content', 'genesis_do_post_content' ); /* Pre-HTML5 */
remove_action( 'genesis_entry_content', 'genesis_do_post_content' ); /* HTML5 */
// add_action( 'genesis_post_content', 'sk_do_post_content' ); /* Pre-HTML5 */
@srikat
srikat / functions.php
Created October 6, 2013 17:26
Show post's published and last updated (if different from published date) in human time in Genesis. Details: http://sridharkatakam.com/using-human-time-last-updated-date-genesis/
<?php
//* Do NOT include the opening php tag
//* Create a shortcode to display published date's human time
add_shortcode('post_date_human', 'set_post_date_human');
function set_post_date_human($atts) {
return human_time_diff( get_the_time('U'), current_time('timestamp') );
}
//* Create a shortcode to display last updated date's human time