Skip to content

Instantly share code, notes, and snippets.

@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 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 / 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 / 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 / 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.
<?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;
}
jQuery(document).ready(function($) {
$(".featured-single").backstretch([BackStretchImg.src],{duration:3000,fade:750});
});
@10h30
10h30 / gist:33cb766b58001e6c6bca
Created July 10, 2015 10:42 — forked from electricbrick/gist:d865d05937d60e47ddb7
Genesis Sandbox Featured Content (GSFC) Widget Subtitles Function
add_action ( 'gsfc_post_content','add_subtitle', 10);
function add_subtitle(){
if ( function_exists( 'the_subtitle' ) ) {
the_subtitle( '<p class="entry-subtitle">', '</p>' );
}
}
@10h30
10h30 / functions.php
Created July 17, 2015 03:57 — forked from srikat/functions.php
Excluding categories when using Display Posts Shortcode. http://sridharkatakam.com/exclude-categories-using-display-posts-shortcode/
//* 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;
}
@10h30
10h30 / functions.php
Last active August 29, 2015 14:27
Modify Genesis Post Author shortcode to display outside the loop
add_filter ( 'genesis_post_author_posts_link_shortcode', 'filter_post_author_posts_link_shortcode', 10, 2);
function filter_post_author_posts_link_shortcode( $output, $atts ) {
global $post;
$id = ($post && property_exists($post,'post_author') && isset($post->post_author)) ? $post->post_author : 0;
$author = get_the_author_meta( 'display_name', $id);
$url = get_author_posts_url( $id );
$output = sprintf( '<span %s>', genesis_attr( 'entry-author' ) );
$output .= $atts['before'];