This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Breaks the posts into 4 columns | |
* @link http://www.billerickson.net/code/grid-loop-using-post-class | |
*/ | |
add_filter( 'post_class', 'tsm_archive_post_class' ); | |
function tsm_archive_post_class( $classes ) { | |
global $wp_query; | |
// Keeps columns out of secondary loops ie: Genesis Featured Post widgets | |
if( ! $wp_query->is_main_query() ) { | |
return $classes; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Filter a few parameters into YouTube oEmbed requests | |
* | |
* @link http://goo.gl/yl5D3 | |
*/ | |
function iweb_modest_youtube_player( $html, $url, $args ) { | |
return str_replace( '?feature=oembed', '?feature=oembed&modestbranding=1&showinfo=0&rel=0', $html ); | |
} | |
add_filter( 'oembed_result', 'iweb_modest_youtube_player', 10, 3 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//* Do NOT include the opening php tag | |
//* Enqueue scripts and styles | |
add_action( 'wp_enqueue_scripts', 'cegg_load_scripts_styles' ); | |
function cegg_load_scripts_styles() { | |
if ( is_singular( array( 'post', 'page' ) ) && has_post_thumbnail() ) { | |
wp_enqueue_script( 'cegg-backstretch', get_bloginfo( 'stylesheet_directory' ) . '/js/backstretch.js', array( 'jquery' ), '1.0.0', true ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
If you are using BP 2.1+, this will insert a Country selectbox. | |
Add the function to bp-custom.php and then visit .../wp-admin/users.php?page=bp-profile-setup | |
Remove this function after the field is created. | |
*/ | |
function bp_add_custom_country_list() { | |
if ( !xprofile_get_field_id_from_name('Country') && 'bp-profile-setup' == $_GET['page'] ) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( ! class_exists( 'Imath_Auto_Join_Groups' ) ) : | |
/** | |
* AutoJoin new members to chosen groups | |
* | |
* This is a little snippet, feel free to : | |
* - use it | |
* - extend it.. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* If you are using BP 2.1+, this will insert a Country selectbox. | |
* Add the function to bp-custom.php and then visit .../wp-admin/users.php?page=bp-profile-setup | |
*/ | |
function bp_add_custom_country_list() { | |
if ( !xprofile_get_field_id_from_name('Country') && 'bp-profile-setup' == $_GET['page'] ) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//* Add class to .site-container | |
add_filter('genesis_attr_site-container', 'jive_attributes_st_container'); | |
function jive_attributes_st_container($attributes) { | |
$attributes['class'] .= ' st-container'; | |
return $attributes; | |
} | |
//* Add class to .site-inner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Modify query to remove a post type from search results, but keep all others | |
* | |
* @author Joshua David Nelson, josh@joshuadnelson.com | |
* @license http://www.gnu.org/licenses/gpl-2.0.html GPLv2+ | |
*/ | |
add_action( 'pre_get_posts', 'jdn_modify_query' ); | |
function jdn_modify_query( $query ) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Smarter version of the buddypress sitewide notices widget | |
* | |
* Fetches the notices in an output buffer and does not display widget when | |
* there is no content to display. | |
* | |
* Sadly this widget is necessary because buddypress only finds out if there | |
* are notices to be displayed while displaying them. | |
* |
OlderNewer