Jump to content


Photo

Header widget for phone and address info.


  • Please log in to reply
6 replies to this topic

#1 smcgeehan

smcgeehan

    Newbie

  • Members
  • Pip
  • 9 posts

Posted 15 July 2011 - 05:21 PM

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.

#2 kastelic

kastelic

    Advocate

  • Members

  • 3081 posts
  • Country: Country Flag

Posted 15 July 2011 - 11:06 PM

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?

#3 smcgeehan

smcgeehan

    Newbie

  • Members
  • Pip
  • 9 posts

Posted 17 July 2011 - 11:36 PM

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.

#4 Kate

Kate

    Advocate

  • Members
  • 3039 posts

Posted 18 July 2011 - 03:19 PM

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(){ ?>

    #5 smcgeehan

    smcgeehan

      Newbie

    • Members
    • Pip
    • 9 posts

    Posted 19 July 2011 - 04:37 AM

    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(){ ?>
    	
    	<ul><?php
    	 dynamic_sidebar( 'Header Widget Area' );
    	?></ul>
    	<?php
    	}
    	?>

    What do you think?

    #6 smcgeehan

    smcgeehan

      Newbie

    • Members
    • Pip
    • 9 posts

    Posted 19 July 2011 - 04:44 AM

    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.

    #7 cmunns

    cmunns

      Advocate

    • Members

    • 6537 posts
    • Country: Country Flag

    Posted 19 July 2011 - 07:37 PM

    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(){ ?>