Skip to content

Instantly share code, notes, and snippets.

<?php
//* Do NOT include the opening php tag
add_action( 'genesis_entry_footer', 'sk_simple_share' );
function sk_simple_share() {
if ( ! function_exists('genesis_share_icon_output') ) {
return;
}
@10h30
10h30 / datatables-init.js
Last active August 29, 2015 14:22 — forked from srikat/datatables-init.js
How to display Posts organized by category as Data Tables in Genesis. http://sridharkatakam.com/display-posts-organized-category-data-tables-genesis/
jQuery(function( $ ){
$('.category-table').DataTable({
// Reference: http://www.datatables.net/reference/option/
// paging: false, // disable table pagination.
pageLength: 25, // initial page length (number of rows per page).
lengthChange: false, // remove the option for end user to change number of records to be shown per page.
// pagingType: 'simple', // http://datatables.net/reference/option/pagingType.
@10h30
10h30 / agency-pro.css
Last active August 29, 2015 14:22 — forked from srikat/agency-pro.css
Replace Header Site Title with Inline Logo
a img {
margin-bottom: 0;
}
.site-title a img {
vertical-align: top;
}
@10h30
10h30 / animations.min.css
Last active March 5, 2017 15:40 — forked from srikat/animations.min.css
Hide header until it is needed in WordPress using Headroom.js. http://sridharkatakam.com/hide-header-needed-wordpress-using-headroom-js/
.animated{-webkit-animation-duration:.5s;-moz-animation-duration:.5s;-o-animation-duration:.5s;animation-duration:.5s;-webkit-animation-fill-mode:both;-moz-animation-fill-mode:both;-o-animation-fill-mode:both;animation-fill-mode:both}@-webkit-keyframes slideDown{0%{-webkit-transform:translateY(-100%)}100%{-webkit-transform:translateY(0)}}@-moz-keyframes slideDown{0%{-moz-transform:translateY(-100%)}100%{-moz-transform:translateY(0)}}@-o-keyframes slideDown{0%{-o-transform:translateY(-100%)}100%{-o-transform:translateY(0)}}@keyframes slideDown{0%{transform:translateY(-100%)}100%{transform:translateY(0)}}.animated.slideDown{-webkit-animation-name:slideDown;-moz-animation-name:slideDown;-o-animation-name:slideDown;animation-name:slideDown}@-webkit-keyframes slideUp{0%{-webkit-transform:translateY(0)}100%{-webkit-transform:translateY(-100%)}}@-moz-keyframes slideUp{0%{-moz-transform:translateY(0)}100%{-moz-transform:translateY(-100%)}}@-o-keyframes slideUp{0%{-o-transform:translateY(0)}100%{-o-transform:translate
@10h30
10h30 / functions.php
Last active August 29, 2015 14:19 — forked from robincornett/functions.php
optional home.php--to show the posts page's title and content
<?php
// do NOT include the opening line! Just add what's below to the end of your functions.php file
add_action( 'edit_form_after_title', 'rgc_posts_page_edit_form' );
function rgc_posts_page_edit_form() {
global $post, $post_type, $post_ID;
$post_ID = isset($post_ID) ? (int) $post_ID : 0;
if ( $post_ID == get_option( 'page_for_posts' ) && empty( $post->post_content ) ) {
add_post_type_support( $post_type, 'editor' );
@10h30
10h30 / functions.php
Last active August 29, 2015 14:19 — forked from srikat/functions.php
Customize the post meta function to show Tags on Category pages, Categories on Tag archives and both Tags and Categories on single Posts and views other than static Pages. http://sridharkatakam.com/different-post-meta-different-views-genesis/
//* Customize the post meta function to show Tags on Category pages, Categories on Tag archives and both Tags and Categories on single Posts and views other than static Pages
add_filter( 'genesis_post_meta', 'sk_post_meta_filter' );
function sk_post_meta_filter($post_meta) {
if ( is_category() ) {
$post_meta = '[post_tags]';
}
elseif ( is_tag() ) {
$post_meta = '[post_categories]';
@10h30
10h30 / functions.php
Last active August 29, 2015 14:19 — forked from srikat/functions.php
How to display Featured images above Posts with Title as overlay. http://sridharkatakam.com/display-featured-images-posts-title-overlay/
//* Register a custom image size for Featured images above entries on list pages
add_image_size( 'archive-featured-image', 800, 300, true );
add_action( 'genesis_before_entry', 'sk_featured_image_above_posts' );
/**
* Display Featured Image above Post Titles regardless of Content Archives settings
*
* Context: Posts page, all archives and search results pages.
*
* @author Sridhar Katakam
<?php
//* Do NOT include the opening php tag
add_action( 'pre_get_posts', 'sk_change_blog_home_posts_per_page' );
/**
* Change Posts Per Page for Blog Home
*
* @author Bill Erickson (original), changed by Sridhar Katakam
* @link http://www.billerickson.net/customize-the-wordpress-query/
* @param object $query data
@10h30
10h30 / genesis-masonry.php
Last active August 29, 2015 14:19 — forked from srikat/genesis-masonry.php
Pinterest-like Masonry layout for Posts page and Archives in Genesis. Details: http://sridharkatakam.com/using-masonry-genesis-pinterest-like-layout/
<?php
//* Do NOT include the opening php tag
// =================================================================
// = Pinterest-like Masonry layout for Posts page and Archives =
// =================================================================
//* Enqueue and initialize jQuery Masonry script
function sk_masonry_script() {
if (is_home() || is_archive()) {
@10h30
10h30 / functions.php
Last active February 3, 2017 00:40 — forked from srikat/functions.php
How to set up animated Search form in Genesis. http://sridharkatakam.com/set-animated-search-form-genesis/
//* Enqueue scripts and styles
add_action( 'wp_enqueue_scripts', 'custom_enqueue_scripts_styles' );
function custom_enqueue_scripts_styles() {
wp_enqueue_style( 'font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css' );
wp_enqueue_script( 'global', get_bloginfo( 'stylesheet_directory' ) . '/js/global.js', array( 'jquery' ), '1.0.0', true );
}