Forum Replies Created
-
AuthorPosts
-
cmillarMember
Thanks to all for the coding help. It's great to know.... but I'm using the "Genesis Widget Generator" with great success. Glad to report on how great it is.
cmillarMemberThis reply has been marked as private.cmillarMemberAh hah!
I'll try this later and will let you know how it is.... looking forward to this.
Have to leave the computer for a few hours for some of my 'other life'.Many thanks.... will get to this late tonight here or in the morning.
cmillarMemberHi again, and thanks.
I'll put in the code I've been trying here, which is basically just a slight change to reflect the 'after_header' widget I'd like to have.
I've been using the instructions from this fellows blog: http://designsbynickthegeek.com/tutorials/add-widgeted-sidebar
I have no way to know if if is correct information or not, but I would assume so.
Seeing as I would like to add widget area to go 'after the header', I started with this snippet:
genesis_register_sidebar( array(
'id' => 'after-header',
'name' => 'After Header',
'description' => 'This is a sidebar that goes after the header.',
) );My actions: - I pasted that code from the blog at the very bottom of my 'functions.php.' file, with the 'after-header' information.
Then, as per the blog site instructions, I pasted this in 'Simple Hooks' in the 'after_header' area:
<div class="after-header">
<?php dynamic_sidebar( 'after-header' ); ?>
</div>My actions: - I also enabled the PHP option in Simple Hooks.
If I do need to go into 'style.css', I guess the code from the blog would be a good starting point for sizing things to see what shows up?
Now, I've read where some bloggers have said I don't need to go into 'style.css' at all for this widget area?Anyways, I tried the above and didn't see any results in my theme.
Any thought and suggestions much appreciated! Don't spend all day on it!
Thanks, Cam
cmillarMemberHello Christoph, and thank you very much for the help here!
(I'm like a 'home mechanic'... I can do minor oil changes and minor car adjustments, but have never rebuilt a motor from the ground up!)What I'd like to do:
- create a widget area in the 'after the header' area (so that I can place a menu plugin or other plugin)I have created a multi-site, and am working with an exact copy of Parallax Pro. The Parallax theme is also used for the main 'entry-way' website that has a link to this other site. It's all working smoothly.
I do have the 'Simple Hooks' plugin, but haven't used it before now. I thought it might make life easier. But, I'm a little confused as to what to do.
(I read somewhere that I might need to create a 'frontpage.php' or something similar?)
I need more knowledge about where to actually place the code for adding widgets and where to place the 'call to actions', when you need to use '}'s', etc. I'm sure once I know that, all should be smooth. Lot's to learn!
Sometimes, when people post examples, they include what seems to be a lot of uneccessary code lines.... which makes it very confusing to many people with less experience. (ie: instructions that are place right above the code in an editor, which makes it hard to distinguish what is needed or not needed)
Thanks for going over the code and for your ideas. Much appreciated!
Here is the original 'functions.php' code (without any of my modifications) from the site I would like to add the new widget area in:
<?php
//* Start the engine
include_once( get_template_directory() . '/lib/init.php' );//* Setup Theme
include_once( get_stylesheet_directory() . '/lib/theme-defaults.php' );//* Set Localization (do not remove)
load_child_theme_textdomain( 'parallax', apply_filters( 'child_theme_textdomain', get_stylesheet_directory() . '/languages', 'parallax' ) );//* Add Image upload to WordPress Theme Customizer
add_action( 'customize_register', 'parallax_customizer' );
function parallax_customizer(){require_once( get_stylesheet_directory() . '/lib/customize.php' );
}
//* Include Section Image CSS
include_once( get_stylesheet_directory() . '/lib/output.php' );//* Child theme (do not remove)
define( 'CHILD_THEME_NAME', 'Parallax-rodeo' );
define( 'CHILD_THEME_URL', 'http://www.ramrodeotour.rossmillargroup.com' );
define( 'CHILD_THEME_VERSION', '1.2' );//* Enqueue scripts and styles
add_action( 'wp_enqueue_scripts', 'parallax_enqueue_scripts_styles' );
function parallax_enqueue_scripts_styles() {wp_enqueue_script( 'parallax-responsive-menu', get_bloginfo( 'stylesheet_directory' ) . '/js/responsive-menu.js', array( 'jquery' ), '1.0.0' );
wp_enqueue_style( 'dashicons' );
wp_enqueue_style( 'parallax-google-fonts', '//fonts.googleapis.com/css?family=Montserrat|Sorts+Mill+Goudy', array(), CHILD_THEME_VERSION );}
//* Add HTML5 markup structure
add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption' ) );//* Add viewport meta tag for mobile browsers
add_theme_support( 'genesis-responsive-viewport' );//* Reposition the primary navigation menu
remove_action( 'genesis_after_header', 'genesis_do_nav' );
add_action( 'genesis_before_content_sidebar_wrap', 'genesis_do_nav' );//* Reposition the secondary navigation menu
remove_action( 'genesis_after_header', 'genesis_do_subnav' );
add_action( 'genesis_footer', 'genesis_do_subnav', 7 );//* Reduce the secondary navigation menu to one level depth
add_filter( 'wp_nav_menu_args', 'parallax_secondary_menu_args' );
function parallax_secondary_menu_args( $args ){if( 'secondary' != $args['theme_location'] )
return $args;$args['depth'] = 1;
return $args;}
//* Unregister layout settings
genesis_unregister_layout( 'content-sidebar-sidebar' );
genesis_unregister_layout( 'sidebar-content-sidebar' );
genesis_unregister_layout( 'sidebar-sidebar-content' );//* Add support for additional color styles
add_theme_support( 'genesis-style-selector', array(
'parallax-pro-blue' => __( 'Parallax Pro Blue', 'parallax' ),
'parallax-pro-green' => __( 'Parallax Pro Green', 'parallax' ),
'parallax-pro-orange' => __( 'Parallax Pro Orange', 'parallax' ),
'parallax-pro-pink' => __( 'Parallax Pro Pink', 'parallax' ),
) );//* Unregister secondary sidebar
unregister_sidebar( 'sidebar-alt' );//* Add support for custom header
add_theme_support( 'custom-header', array(
'width' => 360,
'height' => 70,
'header-selector' => '.site-title a',
'header-text' => false,
) );//* Add support for structural wraps
add_theme_support( 'genesis-structural-wraps', array(
'header',
'nav',
'subnav',
'footer-widgets',
'footer',
) );//* Modify the size of the Gravatar in the author box
add_filter( 'genesis_author_box_gravatar_size', 'parallax_author_box_gravatar' );
function parallax_author_box_gravatar( $size ) {return 176;
}
//* Modify the size of the Gravatar in the entry comments
add_filter( 'genesis_comment_list_args', 'parallax_comments_gravatar' );
function parallax_comments_gravatar( $args ) {$args['avatar_size'] = 120;
return $args;
}
//* Add support for 3-column footer widgets
add_theme_support( 'genesis-footer-widgets', 1 );//* Add support for after entry widget
add_theme_support( 'genesis-after-entry-widget-area' );//* Relocate after entry widget
remove_action( 'genesis_after_entry', 'genesis_after_entry_widget_area' );
add_action( 'genesis_after_entry', 'genesis_after_entry_widget_area', 5 );}
//* Register widget areas
genesis_register_sidebar( array(
'id' => 'home-section-1',
'name' => __( 'Home Section 1', 'parallax' ),
'description' => __( 'This is the home section 1 section.', 'parallax' ),
) );
genesis_register_sidebar( array(
'id' => 'home-section-2',
'name' => __( 'Home Section 2', 'parallax' ),
'description' => __( 'This is the home section 2 section.', 'parallax' ),
) );
genesis_register_sidebar( array(
'id' => 'home-section-3',
'name' => __( 'Home Section 3', 'parallax' ),
'description' => __( 'This is the home section 3 section.', 'parallax' ),
) );
genesis_register_sidebar( array(
'id' => 'home-section-4',
'name' => __( 'Home Section 4', 'parallax' ),
'description' => __( 'This is the home section 4 section.', 'parallax' ),
) );
genesis_register_sidebar( array(
'id' => 'home-section-5',
'name' => __( 'Home Section 5', 'parallax' ),
'description' => __( 'This is the home section 5 section.', 'parallax' ),
) );cmillarMemberQuestion for anyone:
I followed the sample instructions in the blog which is referred to here, but I can't get the widget area to register at all.
I've tried it with the 'Simple Hooks' program, but that hasn't worked.
I'm sure I'm being very careful with the cut and paste instructions.
Is it possible that my site just can't do this sample exercise?
I'm using Parallax Pro in a multi-site situation, and trying to change one site's functions.php by adding in a new widget area, not necessarily the one in this demo.
But it seems like it should be a good model to follow?
cmillarMemberThanks! Lots to learn here.....
-
AuthorPosts