Skip to content

Instantly share code, notes, and snippets.

Sridhar Katakam srikat

Block or report user

Report or block srikat

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@srikat
srikat / style.css
Created Sep 28, 2013
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/
View style.css
/*
Move left section (.site-header) to top
---------------------------------------------------------------------------------------------------- */
/* Custom styles by Sridhar Katakam */
.site-container {
max-width: none;
}
.site-header {
@srikat
srikat / functions.php
Created Sep 28, 2013
Add widget area after .menu in Genesis Primary Nav. Source: https://gist.github.com/NicktheGeek/4503511
View functions.php
//* 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 Sep 29, 2013
Adding a Featured area above posts when using Masonry in Genesis. http://sridharkatakam.com/adding-featured-area-posts-using-masonry-genesis/
View functions.php
<?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
View style.css
/*
Filterable Portfolio
---------------------------------------------------------------------------------------------------- */
ul.filter {
color: #999;
list-style: none;
margin-left: 0;
}
View archive-portfolio.php
<?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);
View page_filterable-portfolio.php
<?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 Oct 5, 2013
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/
View functions.php
<?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 Dec 24, 2015
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/
View functions.php
<?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 */
View functions.php
<?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 Oct 6, 2013
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/
View functions.php
<?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
You can’t perform that action at this time.