Skip to content

Instantly share code, notes, and snippets.

View freezvd's full-sized avatar

Valentin Zmaranda freezvd

  • Bucharest, Romania
View GitHub Profile
@freezvd
freezvd / gist:520a7885dfad864c4fb6
Last active August 29, 2015 14:18 — forked from salcode/gist:7164690
Add custom classes to Genesis WordPress Framework Markup when using HTML5 output
<?php
/*
* Examples to add custom classes to Genesis WordPress Framework Markup when using HTML5 output
*/
add_action( 'genesis_setup', 'srf_add_cust_classes', 15 ); // Priority 15 ensures it runs after Genesis itself has setup.
function srf_add_cust_classes() {
add_filter( 'genesis_attr_site-inner', 'srf_attr_site_inner' );
add_filter( 'genesis_attr_content-sidebar-wrap', 'srf_attr_content_sidebar_wrap' );
add_filter( 'genesis_attr_content', 'srf_attr_content' );
add_filter( 'genesis_attr_sidebar-primary', 'srf_attr_sidebar_primary' );
<?php
//* Do NOT include the opening php tag
//* Add post navigation (requires HTML5 theme support)
add_action( 'genesis_entry_footer', 'genesis_prev_next_post_nav' );
<?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
<h1 itemprop="headline" class="entry-title">About</h1>
<?php
//* Do NOT include the opening php tag
//* Add new image size
add_image_size( 'masonry-thumb', 270, 0, true );
@freezvd
freezvd / gist:8ca323d94261f4323ed3
Created February 15, 2015 11:41
How to Slide Down Search Box in a Full Screen Overlay in Genesis.
<?php
//* Do NOT include the opening php tag
//* Make Font Awesome available
add_action( 'wp_enqueue_scripts', 'enqueue_font_awesome' );
function enqueue_font_awesome() {
wp_enqueue_style( 'font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css' );
}
<?php
//* Do NOT include the opening php tag
add_action( 'genesis_header', 'sk_primary_nav_visibility' );
/**
* Remove Primary Navigation from homepage for all users, keep it visible
* on inner pages but only for logged in users
*
*
* @author Sridhar Katakam
if( genesis_has_post_type_archive_support() ){
$intro_text = genesis_get_cpt_option( 'intro_text' );
if( !empty( $intro_text ) ){
echo apply_filters( 'genesis_term_intro_text_output', $intro_text );
}
}
// Filter the title with a custom function
add_filter('genesis_seo_title', 'wap_site_title' );
// Add additional custom style to site header
function wap_site_title( $title ) {
// Change $custom_title text as you wish
$custom_title = '<span class="custom-title">WA</span>Estate';
// Don't change the rest of this on down