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 Aug 19, 2019
Showing a different menu in Primary Navigation location conditionally in Genesis
View functions.php
<?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/
*/
@srikat
srikat / functions.php
Created Jan 10, 2014
Add Post categories above Post titles and display only Post tags in entry footer in Genesis. Scope: Single Posts, Search results page, static Pages to which 'Blog' Page Template is applied. Context: http://sridharkatakam.com/moving-post-categories-entry-meta-post-title-genesis/#comment-2309
View functions.php
add_action( 'template_redirect', 'sk_categories_above_titles' );
function sk_categories_above_titles() {
if ( ! ( is_singular('post') || is_archive() || is_search() || is_page_template('page_blog.php' ) ) )
return;
add_action ( 'genesis_entry_header', 'sk_show_category_names', 9 );
add_filter( 'genesis_post_meta', 'sk_post_meta_filter' );
}
View functions.php
<?php
//* Do NOT include the opening php tag
//* Enqueue Animate.CSS and WOW.js
add_action( 'wp_enqueue_scripts', 'sk_enqueue_scripts' );
function sk_enqueue_scripts() {
wp_enqueue_style( 'animate', get_stylesheet_directory_uri() . '/css/animate.min.css' );
wp_enqueue_script( 'wow', get_stylesheet_directory_uri() . '/js/wow.min.js', array(), '', true );
@srikat
srikat / test.html
Created May 8, 2018
Dummy Content for Gutenberg
View test.html
<!-- wp:heading -->
<h2>Heading Block (H2)</h2>
<!-- /wp:heading -->
<!-- wp:heading -->
<h3>You are looking at one. (H3)</h3>
<!-- /wp:heading -->
<!-- wp:heading -->
<h2>Subhead Block</h2>
@srikat
srikat / functions.php
Last active Jun 17, 2019
How to remove Post Meta from Entry Footer in Genesis.
View functions.php
add_action( 'genesis_entry_content', 'sk_remove_post_meta' );
/**
* Remove Post Meta in Entry Footer site-wide excerpt on static Pages.
*
* @author Sridhar Katakam
* @link http://sridharkatakam.com/remove-post-meta-entry-footer-genesis/
*/
function sk_remove_post_meta() {
if ( is_singular( 'page' ) ) {
return;
@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 );
You can’t perform that action at this time.