Jump to content
Sign in to follow this  
smcgeehan

Header widget for phone and address info.

Recommended Posts

smcgeehan

Is there a way to put a widget in the top right section of the platform pro, eco pro, iblog or white house theme like this website has? See the top right hand phone and address: dentist.businessforcepro.com I'd like the ability to add a phone number and address with a text widget like the above website has.

Share this post


Link to post
Share on other sites
kastelic

Might have to utilize a hook to get it to fall to the right of your logo. You can put the universal sidebar above your header, but then it takes up the whole width of the page. Could you give a link to your site?

Share this post


Link to post
Share on other sites
smcgeehan

Yup. www.seanmcgeehan.com is the site that I want to put it on. The cruz wordpress theme from theme forest has a widget for this purpose built into the theme. I'd like to do this with a widget in pagelines pro too if possible.

Share this post


Link to post
Share on other sites
Kate

Hey Sean, We can just register a new sidebar for that area. Something like this should work: ` register_sidebar( $args ); $args = array( 'name' => 'Header Widget Area', 'id' => 'sidebar-$i', 'description' => '', 'before_widget' => '', 'after_widget' => '', 'before_title' => '

', 'after_title' => '

' ); add_action ('pagelines_before_branding','add_header_widget'); function add_header_widget(){ ?>
  • <?php dynamic_sidebar( 'Header Widget Area' ); ?>
<?php } ` Didn't try that out, but should work in theory. You'll want to place it in your functions.php file in your Base theme (and make sure your Base theme is activated). Let us know if you have any issues with it.

Share this post


Link to post
Share on other sites
smcgeehan

Hi Kate, Thanks for helping but still no dice. I plugged in the code you gave me and now the code looks like this. I'm using the EcoPro theme from Pagelines.

<?php
	
	// Theme Initialization -- Copyright PageLines 2010 -- Designed by Andrew Powers --
	
	// GET CORE ///////////
	
		if(file_exists(TEMPLATEPATH.'/_core/init_core.php')){
			define('CORE', TEMPLATEPATH . "/_core");
			define('CORENAME', "_core");
		}else{
			define('CORE', TEMPLATEPATH . "/core");
			define('CORENAME', "core");
		}
		get_template_part("core/init_core");
	
	register_sidebar( $args );
	
	$args = array(
		'name'          => 'Header Widget Area',
		'id'            => 'sidebar-$i',
		'description'   => '',
		'before_widget' => '<li id="%1$s" class="widget %2$s">',
		'after_widget'  => '',
		'before_title'  => '<h2 class="widgettitle">',
		'after_title'   => '</h2>' );
	
	add_action ('pagelines_before_branding','add_header_widget');
	
	function add_header_widget(){ ?>
	
	
  • <?php dynamic_sidebar( 'Header Widget Area' ); ?>
<?php } ?>[/code]

What do you think?

Share this post


Link to post
Share on other sites
smcgeehan

Oh I forgot, this is important. There was another widget in the widgets area on the bottom. I tried placing a text widget inside with some text to test it out and nothing showed up.

Share this post


Link to post
Share on other sites
cmunns

It's because you're using EcoPro. Instead of this in functions file ` add_action ('pagelines_before_branding','add_header_widget'); function add_header_widget(){ ?> <?php dynamic_sidebar( 'Header Widget Area' ); ?> <?php } ` You need to add this `dynamic_sidebar( 'Header Widget Area' );` directly to your header.php file.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×