badget

Biggest Sale! Special Offer!

Get 30% discount on all of our single themes with this coupon code: #30%SALE

Hurry up! *Limited time offer*

Trying to add a phone number to the header area

Tagged: 

Viewing 15 posts - 1 through 15 (of 20 total)
  • Author
    Posts
  • #3740
    Jordan Wirkkala
    Participant

    I am trying to add a phone number to go just above my social icons in my header and cannot figure it out. I went through the .php files and I just cannot figure out where to insert it or what the best way to do so would be. I have killed hours on this and could really use some help.

    http://www.newleafcrawlspace.com/

    #3748
    Sanjip Shah
    Participant

    @jordan-wirkkalagmail-com The file you need to edit is header-extensions.php file. The path of this file is theme folder->library folder->structure folder. The code you need to edit is inside the attitude_headerdetails functions. Add your code/text just above this line <?php attitude_socialnetworks( $flag ); ?> which is around line 230. Also use a child theme to make these changes so that you won’t lose the changes when you update the theme.

    #4393
    chavalu
    Participant

    Thanks so much for your devoted support.
    I’ve wanted to do the same thing and was directed to do this also. What would we do to get the site to load from our child’s new header file? Do we add something in the parent’s and/or child’s functions.php file?
    Thank you!

    #4401
    Sanjip Shah
    Participant

    @chavalu To learn about how the functions of parent theme are unhooked from an action hook and how a function from child theme is added to action hook you can visit this link http://themeshaper.com/2009/05/25/action-hooks-wordpress-child-themes/. Below is an example of how its done. Put this code in the functions.php file of the child theme inside a php tag ( <?php code here ?> )

    add_action( ‘init’, ‘attitude_remove_parent_function’ );
    /**
    * Removes parent function attached to hook
    */
    function attitude_remove_parent_function(){
    remove_action( ‘attitude_header’, ‘attitude_headerdetails’, 10 );
    }
    
    add_action( ‘attitude_header’, ‘attitude_child_headerdetails’, 10 );
    /**
    * Add your custom function
    */
    function attitude_child_headerdetails() {
    // Copy all the content inside the attitude_headerdetails function of parent theme, paste here and make necessary changes here.
    }
    #4488
    stefanovd85
    Member

    Hi. I was able to add text above the social media icons. However, how do I edit the size of such text? Any help would be greatly appreciated.

    #4523
    Sanjip Shah
    Participant

    @stefanovd85 In the dashboard, go to Appearance->Theme Options->Design Options Tab->Custom CSS. Paste the following css and click on ‘Save all Changes’.
    .telnumber a { font-size: 20px; }
    Change the px value according to your choice. Try this out.

    #4572
    stefanovd85
    Member

    I tried what you suggested. It did not work. If it helps, the website is http://www.thejacobslaw.com. Thanks

    #4573
    stefanovd85
    Member

    I figured it out, thank you for setting me on the right track. I used:

    .telnumber { font-size: 20px; }

    #4591
    Sanjip Shah
    Participant

    @stefanovd85 Okay. Great!

    #4743
    suntec
    Participant

    @jordan.wirkkala_gmail.com , just a question: I saw your website http://www.newleafcrawlspace.com and it has similiar function implemented what I´ve looking for for long long time. Is it possible that you could disclose me: how did you implement different images in the header area of different pages and a slider on the homepage?

    I would very appriciate if you can give me your valuable advice.

    Best regards
    sx

    #4814
    montefusco.p
    Participant

    I am trying to add a phone number to the header and created a child theme, then copied and modified the header-extensions.php file to my child theme, and added this code
    <a class="telnumber" href="tel:240-415-8323">Call Now: 240-415-8323</a>
    to right above this line
    <?php attitude_socialnetworks( $flag ); ?>

    But the phone number isn’t showing up (the site is montefuscoestateplanning.com) . What am I missing?

    #4816
    stefanovd85
    Member

    Hi. I am sure the developer would know, but have you tried modifying the parent theme files to see if it would work? … in case there is an issue with the child theme?

    #4833
    montefusco.p
    Participant

    Modifying the parent theme files worked. I’ll work some more with the child theme now — thanks so much for your help.

    #7878
    Riou
    Participant

    *Bump

    Has anyone had luck inserting this function inside the child theme? If none, kindly guide me to the right direction.

    add_action( ‘init’, ‘attitude_remove_parent_function’ );
    /**
    * Removes parent function attached to hook
    */
    function attitude_remove_parent_function(){
    remove_action( ‘attitude_header’, ‘attitude_headerdetails’, 10 );
    }
    
    add_action( ‘attitude_header’, ‘attitude_child_headerdetails’, 10 );
    /**
    * Add your custom function
    */
    function attitude_child_headerdetails() {
    // Copy all the content inside the attitude_headerdetails function of parent theme, paste here and make necessary changes here.
    
    global $attitude_theme_options_settings;
       	$options = $attitude_theme_options_settings;
    
       	$elements = array();
    		$elements = array( 	$options[ 'social_facebook' ], 
    									$options[ 'social_twitter' ],
    									$options[ 'social_googleplus' ],
    									$options[ 'social_linkedin' ],
    									$options[ 'social_pinterest' ],
    									$options[ 'social_youtube' ],
    									$options[ 'social_vimeo' ],
    									$options[ 'social_flickr' ],
    									$options[ 'social_tumblr' ],
    									$options[ 'social_myspace' ],
    									$options[ 'social_rss' ]
    							 	);	
    		$flag = 0;
    		if( !empty( $elements ) ) {
    			foreach( $elements as $option) {
    				if( !empty( $option ) ) {
    					$flag = 1;
    				}
    				else {
    					$flag = 0;
    				}
    				if( 1 == $flag ) {
    					break;
    				}
    			}
    		}
    				if( 0 == $options[ 'hide_header_searchform' ] || 1 == $flag ) {
    					<a class="telnumber" href="tel:240-415-8323">Call Now: 240-415-8323</a>
    						attitude_socialnetworks( $flag );
    				if( 0 == $options[ 'hide_header_searchform' ] ) get_search_form();
    					</section><!-- .hgroup-right -->	
    				}
    }

    Thank you for the wonderful theme!

    #7925
    Riou
    Participant

    Help anyone?

Viewing 15 posts - 1 through 15 (of 20 total)
  • You must be logged in to reply to this topic.