Skip to content

Instantly share code, notes, and snippets.

View nutsandbolts's full-sized avatar

Andrea Whitmer nutsandbolts

View GitHub Profile
@WebEndevSnippets
WebEndevSnippets / functions.php
Created January 3, 2014 20:03
Genesis : Add comment count and remove standard comment title
add_action( 'genesis_before_comments' , 'webendev_comment_count' );
/**
* Add comment count and remove standard comment title
*
*/
function webendev_comment_count () {
add_filter( 'genesis_title_comments', '_return_null' );
if ( is_single() ) {
if ( have_comments() ) {
echo '<h3>';
@srikat
srikat / functions.php
Created December 17, 2013 01:54
Showing Footer Widget Areas only on homepage in Education theme. http://sridharkatakam.com/show-footer-widget-areas-homepage-education-theme/
// Show Footer Widget Areas only on homepage
add_action( 'genesis_after_content_sidebar_wrap', 'sk_footer_widget_areas' );
function sk_footer_widget_areas() {
if ( is_home() || is_front_page() )
return;
remove_action( 'genesis_before_footer', 'genesis_footer_widget_areas' );
}
@blogjunkie
blogjunkie / child-theme-settings.php
Last active May 27, 2018 13:45
Integrate the WordPress Media Uploader in Theme Options. Reference this function from your add_meta_box() callback
<?php
function upload_image_metabox() {
echo '<p><strong>Upload image</strong></p>';
echo '<input type="text" id="child_logo_url" name="' . $this->get_field_name( 'welcome-image' ) . '" value="' . esc_attr( $this->get_field_value( 'welcome-image' ) ) . '" size="50" />';
echo '<input id="child_upload_logo_button" type="button" class="button" value="Upload Image" /> ';
?>
<?php //do not include this php tag
add_action ('genesis_after_entry', 'my_custom_loop_func');
function my_custom_loop_func() {
if(is_home())
{
global $wp_query;
if( 2 == $wp_query->current_post ) {
@srikat
srikat / front-page.php
Created October 9, 2013 05:42
To make home featured widgets in Minimum Pro appear site-wide, delete the code provided in first box from front-page.php and add the code provided in the second box in functions.php
if ( is_active_sidebar( 'home-featured-1' ) || is_active_sidebar( 'home-featured-2' ) || is_active_sidebar( 'home-featured-3' ) || is_active_sidebar( 'home-featured-4' ) ) {
//* Add Home featured Widget areas
add_action( 'genesis_before_content_sidebar_wrap', 'minimum_home_featured', 15 );
}