WP Smith

Creating WordPress & Genesis Websites Since 2010

  • Home
  • About
  • Services
  • Blog
  • Contact

Mar 29 2011

How to Make My Own Genesis Child Theme Sidebar Available and Not the Default Primary and Secondary Sidebars

So if you want to make the two original sidebars unavailable, you first need to unregister those sidebars. To do this, add the following to your functions.php file.
[php]//Unregister Sidebars
unregister_sidebar('sidebar');
unregister_sidebar('sidebar-alt');

// Remove Default Genesis Sidebar
remove_action('genesis_sidebar', 'genesis_do_sidebar'); [/php]

Then you need to register your new widget area:
[php]add_action('genesis_sidebar', 'child_do_sidebar');
function child_do_sidebar() { ?>
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Child Sidebar') ){ ?><?php } ?>
<?php }
[/php]

Then add your Child Sidebar:
[php]// Add Child Sidebar
genesis_register_sidebar(array(
'name'=>'Child Sidebar',
'id' => 'sidebar-primary',
'description' => 'This is the primary Child sidebar',
'before_widget' => '<div id="%1$s"><div>',
'after_widget' => "</div></div>n",
'before_title' => '<h4><span>',
'after_title' => "</span></h4>n"
));[/php]

Written by Travis Smith · Categorized: Genesis, Tutorials

Mar 28 2011

How to Set Post Thumbnail Size for Genesis's Child Themes

This is rather easy. In your functions.php file, add this one line of code.
[php]// Add Post Thumbnail Support
set_post_thumbnail_size(300, 165, TRUE);[/php]

For more information on set_post_thumbnail_size, see the WordPress Codex, but generally speaking here is the usage:
[php]<?php set_post_thumbnail_size( $width, $height, $crop ); ?> [/php]

Written by Travis Smith · Categorized: Genesis, Tutorials

Mar 27 2011

How to Add the SubNav or the Secondary Navigation to Certain Pages

Here's how to add the Secondary Navigation to certain pages with the various Genesis options including Fancy Dropdowns, depth, and order. Add this to your functions.php file.

[php]
//just in case: ensures subnav on Genesis Theme Settings is set to true/checked.
$genset=get_option('genesis-settings');
if (!$genset['subnav']) {
$genset['subnav']=1;
update_option('genesis-settings',$genset);
}
//Remove Subnav
remove_action('genesis_after_header', 'genesis_do_subnav');
add_action('genesis_after_header','my_custom_subnav');

function my_custom_subnav () {
$genset['subnav_superfish'] = 1; //1 = Enable Fancy Dropdowns, 0 = Disable
$genset['subnav_home'] = 0; //1 = Display home, 0 = Disable
$genset['subnav_type'] = 'categories'; // pages = List of Pages, categories = List of Categories, nav-menu = Custom Nav Menu
$genset['subnav_pages_sort'] = menu_order; // menu_order = Menu Order, post_title = Title, ID = ID, post_date = Date Created, post_modified = Date Modified, post_author = Author, post_name = Slug
$genset['subnav_categories_sort'] = post-title; // menu_order = Menu Order, post_title = Title, ID = ID, post_date = Date Created, post_modified = Date Modified, post_author = Author, post_name = Slug
$genset['subnav_depth'] = 0; // 0 = No Limit, 1, 2, 3, 4
update_option('genesis-settings',$genset);

$pages = array(1,2,3); //insert whatever page ids, slugs etc.
if (is_page($pages)) {
genesis_do_subnav();
}
}[/php]

Written by Travis Smith · Categorized: Genesis, Tutorials

Mar 26 2011

How to Unregister or Remove the Secondary Sidebar

Ever get the question, "I placed my widget in the sidebar but it doesn't appear! Why!?" only to discover that they moved the item to the Secondary Sidebar. How about just removing that sidebar altogether? Here's how:

[php]unregister_sidebar('sidebar-alt');[/php]

Written by Travis Smith · Categorized: Genesis, Tutorials

Mar 25 2011

How to UnRegister Unused Page Layouts

Sometimes limiting options saves a lot of headaches, questions, and time-wasters. You've delivered on the Statement of Work and to prevent minimal maintenance, it may just be easier to unregister some site layouts. Here's how to do that in Genesis.

[php]// Unregister other site layouts
genesis_unregister_layout( 'content-sidebar' );
genesis_unregister_layout( 'sidebar-content' );
genesis_unregister_layout( 'content-sidebar-sidebar' );
genesis_unregister_layout( 'sidebar-sidebar-content' );
genesis_unregister_layout( 'sidebar-content-sidebar' );[/php]

Written by Travis Smith · Categorized: Genesis, Tutorials

  • « Previous Page
  • 1
  • …
  • 7
  • 8
  • 9
  • 10
  • 11
  • …
  • 18
  • Next Page »
  • Twitter
  • Facebook
  • LinkedIn
  • Google+
  • RSS

Copyright © 2025 � WP Smith on Genesis on Genesis Framework � WordPress � Log in