Community Forums › Forums › Archived Forums › Design Tips and Tricks › Can I customize my header when using the Freelance theme?
Tagged: Freelance Header
- This topic has 2 replies, 2 voices, and was last updated 11 years, 8 months ago by marybaum.
-
AuthorPosts
-
May 22, 2013 at 2:16 pm #42246FlourishMember
I am working on customizing a studiopress theme "Freelance" and having a lot of trouble figuring out how to customize the header.
What I am working on is at the following url http://www.blog.theknittingdude.com
And I am trying to add a wholesale section between the logo and the search box that looks the same as this site http://www.theknittingdude.com
I can't even figure out where to edit the header file to edit.
Any ideas from the gurus?
Thanks!
http://blog.theknittingdude.comMay 22, 2013 at 2:55 pm #42252marybaumParticipantFirst, forgive me if I add instructions that are obvious to you or sound way below your coding level. Dollars to donuts your php is better than mine, so I'm writing this as if I were writing to me, or to another designer-turning-developer like me.
The header file you to edit doesn't exist in the Freelance chile them, and it isn't even the one in the top level ov the theme - it's the one in lib/structure. So you actually want to copy the lib/structure folders to your Freelance directory and put your copy of that header.php in there.
Now if you're a better phper than I am, you already know you want to edit the function genesis_do-header - around line 881 in my copy of Taco html editor.
function genesis_do_header() {
echo '<div id="title-area">';
do_action( 'genesis_site_title' );
do_action( 'genesis_site_description' );
echo '</div><!-- end #title-area -->';if ( is_active_sidebar( 'header-right' ) || has_action( 'genesis_header_right' ) ) {
echo '<div class="widget-area">';
do_action( 'genesis_header_right' );
add_filter( 'wp_nav_menu_args', 'genesis_header_menu_args' );
dynamic_sidebar( 'header-right' );
remove_filter( 'wp_nav_menu_args', 'genesis_header_menu_args' );
echo '</div><!-- end .widget-area -->';
}}
what I would do is this:
function genesis_do_header() {
echo '<div id="title-area">';
do_action( 'genesis_site_title' );
do_action( 'genesis_site_description' );
echo '</div><!-- end #title-area -->';if ( is_active_sidebar( 'wholesale'){
echo '<div class="wholesale">';
echo '</div><!-- end .wholesale -->';}
if ( is_active_sidebar( 'header-right' )|| has_action( 'genesis_header_right' ) ) {
echo '<div class="widget-area">';do_action( 'genesis_header_right' );
add_filter( 'wp_nav_menu_args', 'genesis_header_menu_args' );
dynamic_sidebar( 'header-right' );
remove_filter( 'wp_nav_menu_args', 'genesis_header_menu_args' );
echo '</div><!-- end .widget-area -->';
}}
Then edit the Freelance child theme's functions.php file to register the new widget area.
genesis_register_sidebar (array(
'name'=>'wholesale',
'id' => 'wholesales',
'description' => 'This is the wholesale div of the header.'));
and add the class .wholesale to your stylesheet.
I haven't actually tried this to make sure it works, but I did open the files in my code eitor - as always, more experienced php coders feel free to add corrections or improvements.
Sharing the good news about the wonders of modern CSS and the split-step. Either one should get you moving fast. 😀
May 22, 2013 at 3:00 pm #42254marybaumParticipantAlso, it looks as if your site works ag http://blog.theknittingdude.com but not http://www.blog.theknittingdude.com. If the Freelance install you're working on is just going to be a subdomain, that explains it - the www may just have been fingers on autopilot. If it were me, that would be my excuse! 😉
Mary
Sharing the good news about the wonders of modern CSS and the split-step. Either one should get you moving fast. 😀
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.