Skip to content

Instantly share code, notes, and snippets.

View srikat's full-sized avatar

Sridhar Katakam srikat

View GitHub Profile
@srikat
srikat / page_portfolio_view.php
Last active August 29, 2015 13:56
Custom Page Template that shows latest CPT entry in each custom taxonomy in Genesis. http://sridharkatakam.com/custom-page-template-shows-latest-cpt-entry-custom-taxonomy-genesis/
<?php
/*
Template Name: Portfolio View
*/
# Force full width content
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
//* Add portfolio view body class to the head
add_filter( 'body_class', 'executive_add_portfolio_view_body_class' );
@srikat
srikat / functions.php
Last active August 29, 2015 13:56
TechCrunch-like Featured Content Blocks in Genesis. http://sridharkatakam.com/techcrunch-like-featured-content-blocks-genesis/
//* Add new image sizes
add_image_size( 'home-featured-left', 555, 350, true );
add_image_size( 'home-featured-right', 150, 90, true );
//* Register Left and Right Home Featured widget areas
genesis_register_sidebar( array(
'id' => 'home-featured-left',
'name' => 'Home Featured Left',
'description' => 'This is the home featured left section'
) );
@srikat
srikat / page_blog.php
Created February 19, 2014 10:01
Displaying Page content above Posts when using Blog template in Genesis. http://sridharkatakam.com/display-page-content-posts-using-blog-template-genesis/
<?php
//* Show page content above posts
add_action( 'genesis_loop', 'genesis_standard_loop', 5 );
genesis();
@srikat
srikat / gist:9093384
Last active August 29, 2015 13:56
Adding support for Tags and displaying Portfolio Types and Tags in Executive Pro. http://sridharkatakam.com/adding-support-tags-displaying-portfolio-types-tags-executive-pro/
'taxonomies' => array( 'portfolio-type' ),
@srikat
srikat / functions.php
Created February 24, 2014 05:05
Top Header sticks, slides up on scroll down, and fades back in sticky place on scrolling up in Genesis. http://www.youtube.com/watch?v=iNtOJm2q9lA
//* Enqueue Header Fade script
add_action( 'wp_enqueue_scripts', 'sk_enqueue_scripts' );
function sk_enqueue_scripts() {
wp_enqueue_script( 'header-fade', get_bloginfo( 'stylesheet_directory' ) . '/js/header-fade.js', array( 'jquery' ), '', true );
}
@srikat
srikat / front-page.php
Created February 27, 2014 13:57
Parallax background image in Enterprise Pro using Stellar.js. http://sridharkatakam.com/parallax-background-image-enterprise-pro-using-stellar-js/
function enterprise_home_top_widgets() {
genesis_widget_area( 'home-top', array(
'before' => '<div class="home-top widget-area parallax-section" data-stellar-background-ratio="0.5"><div class="wrap">',
'after' => '</div></div>',
) );
}
@srikat
srikat / bxslider-init.js
Last active August 29, 2015 13:56
Testimonials Slider in WordPress using Types, Views and bxSlider. http://sridharkatakam.com/testimonials-slider-wordpress-using-types-views-bxslider/
jQuery(document).ready(function($) {
$('.bxslider').bxSlider({
auto: true,
autoControls: true,
autoHover: true
});
});
@srikat
srikat / functions.php
Last active August 29, 2015 13:56
Adding a Widget Area above static Pages' content in Agency Pro. http://sridharkatakam.com/add-widget-area-static-pages-content-agency-pro/
//* Register Above Page Content widget area
genesis_register_sidebar( array(
'id' => 'above-page-content',
'name' => __( 'Above Page Content', 'agency' ),
'description' => __( 'This is the above page content section of the homepage.', 'agency' ),
) );
//* Display the content of 'Above Page Content' widget area above content on static Pages
add_action( 'genesis_before_loop', 'sk_above_page_content' );
function sk_above_page_content() {
@srikat
srikat / gist:9330556
Last active August 29, 2015 13:56
Page specific HTML in Header Right Widget Area in Genesis using Advanced Custom Fields. http://sridharkatakam.com/page-specific-html-header-right-widget-area-genesis-using-advanced-custom-fields/
//* Remove the header right widget area for static Pages
add_action('genesis_meta', 'sk_unregister_header_right');
function sk_unregister_header_right() {
if (is_singular('page' )) {
unregister_sidebar( 'header-right' );
}
}
@srikat
srikat / style.css
Last active August 29, 2015 13:57
Adding a Video section in Centric Pro. http://sridharkatakam.com/adding-video-section-centric-pro/
<div class="three-fourths first">
<iframe width="960" height="540" src="//www.youtube.com/embed/XZzRUootFUE?rel=0" frameborder="0" allowfullscreen></iframe>
</div>
<div class="one-fourth">
<header class="entry-header">
<h2 class="entry-title">
<a href="http://centric-pro.dev/mobile-responsive/" title="Mobile Responsive">Mobile Responsive</a>
</h2>
</header>