Here's collection of Code snippets of Genesis Framework for WordPress. These code snippets are supposed to be used in functions.php of child theme. You can use these code snippets in existing official genesis themes or while making your own themes.
These code snippets helps you make changes to your layout and allows you to control how you manage the look and feel of the template. This hub will be regularly updated with the new code snippets as I use or come across on the web.
These code snippets helps you make changes to your layout and allows you to control how you manage the look and feel of the template. This hub will be regularly updated with the new code snippets as I use or come across on the web.
Learn HTML to WordPress Conversion.
Where to put these code snippets?
Your genesis child theme has functions.php file. Open the functions.php file from the wordpress interface or upload the functions.php via ftp to your Genesis Themes folder.
Header Code Snippets
Here are some of the code snippets that you can use to edit the genesis child theme header.
You'll find following :
- Add Custom Background
- Add Support for Custom Header
- Remove Header
- Remove Title & Description
- Custom Header URL
- Remove Header Right Widget Area
Navigation Code Snippets
You'll find the following Navigation Code Snippets.
- Move Navigation Menu
- Secondary Navigation Menu
- Unregister Navigation Menus
- Reposition Navigation
Theme Layout Code Snippets
There are some easy layout fixes for the genesis child theme.
- Force Layout Setting
- Register Default Layout Setting
- Unregister Layout Settings
- Add Structural Wraps
Admin Management Code Snippet
Some admin level settings you can edit:
- Color Style Options
- Managing Settings
Managing Settings // Remove Genesis in-post SEO Settings remove_action( 'admin_menu', 'genesis_add_inpost_seo_box' ); // Remove Genesis Layout Settings remove_theme_support( 'genesis-inpost-layouts' ); // Remove Genesis menu link remove_theme_support( 'genesis-admin-menu' ); // Remove Genesis SEO Settings menu link remove_theme_support( 'genesis-seo-settings-menu' ); Color Style Options // Create color style options add_theme_support( 'genesis-style-selector', array( 'theme-blue' => __( 'Blue', 'custom-theme-text-domain' ), 'theme-green' => __( 'Green', 'custom-theme-text-domain' ), 'theme-orange' => __( 'Orange', 'custom-theme-text-domain' ), 'theme-red' => __( 'Red', 'custom-theme-text-domain' )) );
Post Meta Code Snippets
Genesis Post Meta Code Snippets are as follows:
- Remove Post info and Post Meta
- Remove Edit (Post) Link
- Add Post Image above Title
- Custom Post Info
- Custom Post Meta
- Change Avatar Size
- Remove Breadcrumbs
- Change Read More Link
Sidebar Code Snippets
Some of the sidebar tweaks include:
- Remove Sidebar
- Add Custom Sidebar
- Add Widgets in Sidebar
- Unregister Genesis Sidebar Layout
Footer Code Snippet
Footer Code snippets are as follows:
- Custom Footer Credits with Less information
- Custom Footer with Disclosure and Policy Links
- Remove Footer Widgets
- Remove Footer
- Reposition the Footer
'; }/** Remove footer widgets */ remove_theme_support( 'genesis-footer-widgets', 3 ); Remove Footer /** Remove Footer */ remove_action( 'genesis_footer', 'genesis_do_footer' );Reposition the Footer // 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 ); Custom Footer Credits with Less information add_filter('genesis_footer_creds_text', 'custom_footer_creds_text'); function custom_footer_creds_text($creds) { $creds = '[footer_copyright] ' . get_bloginfo('name') ; return $creds; } Custom Footer with Disclosure and Policy Links /** Footer */ remove_action('genesis_footer', 'genesis_do_footer'); add_action('genesis_footer', 'eo_custom_footer'); function eo_custom_footer() { echo ''; echo 'Copyright © '; echo '2011 - '; echo date('Y'); echo ' · Disclosure · Privacy Policy · All rights reserved'; echo '