Skip to content

Instantly share code, notes, and snippets.

Avatar

Brian Gardner bgardner

View GitHub Profile
@bgardner
bgardner / functions.php
Last active Dec 10, 2015
Add custom body class to the head of your site using the Genesis Framework.
View functions.php
<?php
//* Do NOT include the opening php tag
//* Add custom body class to the head
add_filter( 'body_class', 'add_body_class' );
function add_body_class( $classes ) {
$classes[] = 'custom-class';
return $classes;
}
@bgardner
bgardner / functions.php
Last active Dec 10, 2015
Add support for structural wraps in your site using the Genesis Framework.
View functions.php
<?php
//* Do NOT include the opening php tag
//* Add support for structural wraps
add_theme_support( 'genesis-structural-wraps', array(
'header',
'nav',
'subnav',
'inner',
'footer-widgets',
@bgardner
bgardner / functions.php
Last active Dec 10, 2015
Genesis post formats.
View functions.php
<?php
//* Do NOT include the opening php tag
//* Add support for post format images
add_theme_support( 'genesis-post-format-images' );
//* Add support for post formats
add_theme_support( 'post-formats', array(
'aside',
'audio',
@bgardner
bgardner / functions.php
Last active Oct 16, 2020
Remove the edit link on your site using the Genesis Framework.
View functions.php
<?php
//* Do NOT include the opening php tag
//* Remove the edit link
add_filter ( 'genesis_edit_post_link' , '__return_false' );
@bgardner
bgardner / functions.php
Last active Dec 10, 2015
Reposition the breadcrumbs on your site using the Genesis Framework.
View functions.php
<?php
//* Do NOT include the opening php tag
//* Reposition the breadcrumbs
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
add_action( 'genesis_after_header', 'genesis_do_breadcrumbs' );
@bgardner
bgardner / functions.php
Last active Dec 10, 2015
Customize the search form on your site using the Genesis Framework.
View functions.php
<?php
//* Do NOT include the opening php tag
//* Customize search form input box text
add_filter( 'genesis_search_text', 'custom_search_text' );
function custom_search_text($text) {
return esc_attr( 'Search my blog...' );
}
//* Customize search form input button text
@bgardner
bgardner / functions.php
Last active Dec 10, 2015
Reposition the footer of your site using the Genesis Framework.
View functions.php
<?php
//* Do NOT include the opening php tag
//* Reposition the footer
remove_action( 'genesis_footer', 'genesis_footer_markup_open', 5 );
remove_action( 'genesis_footer', 'genesis_do_footer' );
remove_action( 'genesis_footer', 'genesis_footer_markup_close', 15 );
add_action( 'genesis_after', 'genesis_footer_markup_open', 11 );
add_action( 'genesis_after', 'genesis_do_footer', 12 );
add_action( 'genesis_after', 'genesis_footer_markup_close', 13 );
@bgardner
bgardner / functions.php
Last active Dec 10, 2015
Register a widget area for your site using the Genesis Framework.
View functions.php
<?php
//* Do NOT include the opening php tag
//* Register widget area
genesis_register_sidebar( array(
'id' => 'sample',
'name' => __( 'Sample', 'custom-theme-text-domain' ),
'description' => __( 'This is the sample widget area description.', 'custom-theme-text-domain' ),
) );
@bgardner
bgardner / functions.php
Last active Jun 13, 2016
Customize the author box on your site using the Genesis Framework.
View functions.php
<?php
//* Do NOT include the opening php tag
//* Remove author box on single posts
remove_action( 'genesis_after_post', 'genesis_do_author_box_single' );
//* Display author box on single posts
add_filter( 'get_the_author_genesis_author_box_single', '__return_true' );
//* Display author box on archive pages
@bgardner
bgardner / functions.php
Last active Oct 19, 2019
Load a custom style sheet on your site using the Genesis Framework.
View functions.php
<?php
//* Do NOT include the opening php tag
//* Load custom style sheet
add_action( 'wp_enqueue_scripts', 'custom_load_custom_style_sheet' );
function custom_load_custom_style_sheet() {
wp_enqueue_style( 'custom-stylesheet', CHILD_URL . '/custom.css', array(), PARENT_THEME_VERSION );
}
//* Replace default style sheet
You can’t perform that action at this time.