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 / functions.php
Last active Jun 4, 2019
How to use WordPress Customizer for setting up Background Image of a section in Genesis. https://sridharkatakam.com/how-to-use-wordpress-customizer-for-setting-up-background-image-of-a-section-in-genesis/
View functions.php
/**
* Theme Options Customizer Implementation.
*
* @link http://ottopress.com/2012/how-to-leverage-the-theme-customizer-in-your-own-themes/
*
* @param WP_Customize_Manager $wp_customize Object that holds the customizer data.
*/
function sk_register_theme_customizer( $wp_customize ){
/*
View functions.php
// Load Flexbox Grid
add_action( 'wp_enqueue_scripts', 'sk_enqueue_flexbox_grid' );
function sk_enqueue_flexbox_grid() {
wp_enqueue_style( 'flexboxgrid', CHILD_URL . '/css/flexboxgrid.min.css' );
}
View functions.php
//* Display Posts Shortcode - Exclude Categories
add_filter( 'display_posts_shortcode_args', 'be_display_posts_shortcode_exclude_categories', 10, 2 );
function be_display_posts_shortcode_exclude_categories( $args, $atts ) {
if( isset( $atts['cat_not_in'] ) ) {
$categories = explode( ',', $atts['cat_not_in'] );
$args['category__not_in'] = $categories;
}
@srikat
srikat / functions.php
Last active Apr 29, 2019
Fading in last sidebar widget as it is scrolled to and making it fixed in Genesis. http://sridharkatakam.com/fade-last-sidebar-widget-scrolled-make-fixed-genesis/
View functions.php
add_action( 'wp_enqueue_scripts', 'enqueue_sticky_last_widget' );
function enqueue_sticky_last_widget() {
wp_enqueue_style( 'animate', get_stylesheet_directory_uri() . '/css/animate.min.css' );
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' );
wp_enqueue_script( 'jquery-sticky', get_stylesheet_directory_uri() .'/js/jquery.sticky.js' , array( 'jquery' ), '1.0.0' );
wp_enqueue_script( 'jquery-sticky-init', get_stylesheet_directory_uri() .'/js/jquery.sticky.init.js' , array( 'jquery-sticky' ), '1.0.0' );
@srikat
srikat / functions.php
Last active Apr 25, 2019
Moving Post Title and Post Info from Entry Header to Entry Content in Genesis. http://sridharkatakam.com/move-post-title-post-info-entry-header-entry-content-genesis/
View functions.php
//* Move Post Title and Post Info from inside Entry Header to Entry Content on Posts page
add_action( 'genesis_before_entry', 'reposition_entry_header' );
function reposition_entry_header() {
if ( is_home() ) {
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 );
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 );
View archive-staff.php
<?php
/**
* This file adds the custom staff post type archive template.
*
*/
//* Force full width content layout
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
//* Remove the breadcrumb navigation
View style.css
#nav ul, #subnav ul {
float: none;
width: auto;
display: table;
margin: 0 auto;
}
View category.php
<?php
/**
* This file adds the category archive template.
*
*/
//* Force full width content layout
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
//* Remove the breadcrumb navigation
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
Last active Apr 23, 2019
Force a layout for Pages that have subpages in Genesis. https://sridharkatakam.com/force-layout-pages-subpages-genesis/
View functions.php
// Apply layout to static Pages that have children (subpages)
add_action( 'get_header', 'sk_force_layout' );
function sk_force_layout() {
global $post;
// if we are on a static Page and if it does not have a parent
if ( is_singular( 'page' ) && !$post->post_parent ) {
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_content_sidebar' );
}
You can’t perform that action at this time.