Skip to content

Instantly share code, notes, and snippets.

View srikat's full-sized avatar

Sridhar Katakam srikat

View GitHub Profile
@srikat
srikat / functions.php
Last active December 24, 2015 20:19
Code to add in Sixteen Nine Pro's functions.php to add a Home Featured widget area above posts on homepage. http://sridharkatakam.com/add-home-featured-section-posts-homepage-sixteen-nine-pro/
<?php
//* Do NOT include the opening php tag
genesis_register_sidebar( array(
'id' => 'home-featured',
'name' => __( 'Home Featured', 'sixteen-nine' ),
'description' => __( 'This is the home featured section.', 'sixteen-nine' ),
) );
/** Add the home featured section */
@srikat
srikat / functions.php
Created October 6, 2013 18:51
Code to add in Genesis child theme, eleven40 Pro to add a Home Featured widget area above posts on homepage. Based on http://www.briangardner.com/home-widget-area-eleven40/
<?php
//* Do NOT include the opening php tag
genesis_register_sidebar( array(
'id' => 'home-featured',
'name' => __( 'Home Featured', 'eleven40' ),
'description' => __( 'This is the home featured section.', 'eleven40' ),
) );
/** Add the home featured section */
@srikat
srikat / functions.php
Last active December 24, 2015 21:09
Metro Pro: How to make a 560 x 150 logo (uploaded as Header) responsive with a search widget in 'Header Right' widget area. http://sridharkatakam.com/adding-responsive-logo-metro-pro/
<?php
//* Do NOT include the opening php tag
//* Add support for custom header
add_theme_support( 'custom-header', array(
// 'width' => 270,
// 'height' => 80,
'width' => 560,
'height' => 150,
'header-selector' => '.site-title a',
@srikat
srikat / front-page.php
Created October 9, 2013 05:42
To make home featured widgets in Minimum Pro appear site-wide, delete the code provided in first box from front-page.php and add the code provided in the second box in functions.php
if ( is_active_sidebar( 'home-featured-1' ) || is_active_sidebar( 'home-featured-2' ) || is_active_sidebar( 'home-featured-3' ) || is_active_sidebar( 'home-featured-4' ) ) {
//* Add Home featured Widget areas
add_action( 'genesis_before_content_sidebar_wrap', 'minimum_home_featured', 15 );
}
@srikat
srikat / gist:6897105
Created October 9, 2013 06:34
How to replace site tagline in .site-tagline-left with a widgeted area in Minimum Pro
In functions.php, replace
printf( '<p %s>%s</p>', genesis_attr( 'site-description' ), esc_html( get_bloginfo( 'description' ) ) );
with
genesis_widget_area( 'site-tagline-left' );
and add
@srikat
srikat / functions.php
Last active December 25, 2015 01:59
To add a widgeted area below header or subnav (if present) in Genesis child theme, Blissful. Don't forget to go to Appearance -> Widgets and place your desired content via a widget in the "Leaderboard Ad" sidebar.
<?php
//* Do NOT include the opening php tag
genesis_register_sidebar( array(
'id' => 'leaderboard-ad',
'name' => __( 'Leaderboard Ad', 'blissful' ),
'description' => __( 'This is below header section.', 'blissful' ),
) );
add_action( 'genesis_after_header', 'sk_add_widget_area_below_header', 9 );
@srikat
srikat / functions.php
Last active October 14, 2017 21:47
Force excerpts in Search results page regardless of Content Archives themes settings in Genesis
add_action( 'genesis_before_loop', 'sk_excerpts_search_page' );
function sk_excerpts_search_page() {
if ( is_search() ) {
add_filter( 'genesis_pre_get_option_content_archive', 'sk_show_excerpts' );
}
}
function sk_show_excerpts() {
return 'excerpts';
}
@srikat
srikat / functions.php
Last active December 25, 2015 04:09
Adding a widget area below header in Agency Pro. http://sridharkatakam.com/adding-widget-area-header-agency-pro/
<?php
//* Do NOT include the opening php tag
//* Add support for structural wraps
add_theme_support( 'genesis-structural-wraps', array(
'header',
'site-tagline',
'nav',
'subnav',
'home-featured',
@srikat
srikat / functions.php
Created October 14, 2013 06:15
To incorporate Minimum Pro’s Home Featured Widget Areas in eleven40 Pro. We are restricting the code to homepage and a couple of selected Pages (IDs 2 and 83).
<?php
//* Start the engine
include_once( get_template_directory() . '/lib/init.php' );
//* Set Localization (do not remove)
load_child_theme_textdomain( 'eleven40', apply_filters( 'child_theme_textdomain', get_stylesheet_directory() . '/languages', 'eleven40' ) );
//* Child theme (do not remove)
define( 'CHILD_THEME_NAME', __( 'eleven40 Pro Theme', 'eleven40' ) );
define( 'CHILD_THEME_URL', 'http://my.studiopress.com/themes/eleven40/' );
@srikat
srikat / functions.php
Created October 19, 2013 11:41
Split footer in Genesis
add_shortcode( 'sitename', 'site_name' );
function site_name() {
return '<a href="' . get_bloginfo( 'url' ) . '" title="' . get_bloginfo( 'sitename' ) . '">' . get_bloginfo( 'name' ) . '</a>';
}
//* Change the footer text
add_filter('genesis_footer_creds_text', 'sp_footer_creds_filter');
function sp_footer_creds_filter( $creds ) {
$creds = '