-
AuthorPosts
-
July 16, 2014 at 10:22 pm #292251
Hello,
I was wondering if you could help me, as I’m trying to add a phone number and contact button into my main header (not the bar above). I found some documentation on it here : https://kriesi.at/support/topic/header-with-social-icons-and-bottom-use-text-instead-of-social-icons/#post-215140 , but I am not seeing the code that you’re mentioning to find in header.php, and there are also a variety of conversations for various fixes… was wondering if you could condense it and let me know what my next steps are? Thanks so much! :)
July 16, 2014 at 10:35 pm #292252Hi ChelseaH
Please add following code to Funtions.php file in Appearance > Editor
add_action('ava_after_main_menu','logo_text'); function logo_text() { echo "<div class='logo-text'>This is my custom text!</div>"; }
then add following code to Quick CSS in Enfold theme options under General Styling tab and adjust as needed
.logo-text { position: relative; top: -120px; left: 80%; }
Cheers!
YigitJuly 16, 2014 at 11:04 pm #292276Wow, thanks for your quick response, it worked great! Thanks so much :)
July 16, 2014 at 11:07 pm #292279Sorry, one quick question to add to this, where do I adjust my custom content here? Is it in the functions.php page, or elsewhere? I was hoping to also add a button. Thanks :)
ChelseaJuly 16, 2014 at 11:16 pm #292289Hi Chelsea!
In functions.php, to add a button:
add_action('ava_after_main_menu','logo_text'); function logo_text() { echo "<div class='logo-text'>"; echo "This is my custom text!"; echo do_shortcode("[av_button label='Click me' link='manually,http://' link_target='' color='theme-color' custom_bg='#444444' custom_font='#ffffff' size='small' position='center' icon_select='yes' icon='ue800' font='entypo-fontello']"); echo "</div>"; }
Cheers!
JosueJuly 16, 2014 at 11:17 pm #292290Hey!
Please see the first code i posted, there is “This is my custom text!”, this is where you should change. You can simply use HTML inside it as shown here – http://pastebin.com/9GVtxqgg
But please use single quotes for HTML codesCheers!
YigitJuly 17, 2014 at 12:10 pm #292411Hi guys,
This doesn’t seem to work with the latest version of Enfold (v2.9) – I get a white screen of death.
Also, what would the code be if I wanted to add it to a child theme’s functions.php rather than Enfolds functions.php please? (I’m a php newbie sorry!)
Thanks,
Matt
July 17, 2014 at 12:41 pm #292420Hey!
Please undo the changes you made on functions.php file via FTP, site should be working once again. If you do not mind, please post a temporary admin login so we can add the code for you
Cheers!
YigitJuly 18, 2014 at 12:59 pm #292935Hi Yigit,
Thanks. I was able to undo the change no problem and although I’m clueless when it comes to PHP you only have to give me the code and I know where to put it, I just don’t know the exact code.
Regards,
Matt
July 18, 2014 at 1:42 pm #292950Hey!
You can copy&paste this code – http://pastebin.com/gThAyenF
Then you can style the button using following code in Quick CSS.header-button { padding: 5px; border-radius: 5px; background-color: red; color: white; }
If you would like to use Enfold’s default buttons, please use the code Josue posted here – https://kriesi.at/support/topic/adding-phone-number-text-and-button-to-main-header/#post-292289
Regards,
YigitJuly 19, 2014 at 7:43 pm #293444Help! Now I am also getting the white screen … I can’t access anything and my website is gone :S
July 20, 2014 at 6:25 am #293528Hey!
Thank you for the update.
Maybe you added an apostrophe on the custom text. Please get a new copy of functions.php then override the old one via FTP.
Regards,
IsmaelJuly 21, 2014 at 10:16 pm #294051Thanks for getting back to me… I’ve re-uploaded a new functions.php file, and have removed the old, and now I can work in the back end, but my site is still not showing up. I haven’t done any changes to the new functions.php page yet.
July 21, 2014 at 10:18 pm #294054( I put the functions.php file under “framework” … is this where it’s supposed to be?)
July 21, 2014 at 11:22 pm #294071Hi!
The functions.php file should be located in the theme folder root (/wp-content/themes/enfold). Regarding the custom function try using this plugin to add it.
Regards,
JosueJuly 22, 2014 at 4:54 am #294159Ahhh ok, awesome thank you!! Hopefully just two more questions (I’m working in the Functionality plugin now, and it’s working great), but I’m wondering how I format my button to be aligned with my phone number. Also, is there a way to make it so that it doesn’t increase the size of the header ?I don’t want it to look like it does now, pushing down on top of the web page content.
July 22, 2014 at 5:03 am #294165This reply has been marked as private.July 22, 2014 at 5:58 am #294175Hey!
Try adding this code to the Quick CSS:
#header_main_alternate .avia-button-wrap { position: absolute; left: 10px; top: 65px; }
Cheers!
JosueJuly 26, 2014 at 11:01 pm #296279Thanks so much Josue, that worked great. The only issue I have now, though, is that there’s space beneath the menu which overlaps my slider and content below. I don’t see any padding anywhere in the css, and am not sure how to get rid of it :S Also, I would love to get my gold background beneath my text in my layer slider to cover the entire background (it only does on mobile at this point). Any pointers for that?
July 28, 2014 at 5:11 pm #296887Hi!
Please add following code to Quick CSS as well
.html_header_top.html_header_sticky #top #wrap_all #main { padding-top: 178px; } h3.ls-l, .ls-gpuhack { left: 0!important; }
Cheers!
YigitJuly 28, 2014 at 10:39 pm #297041Hi Yigit,
I’m not seeing any changes with that code?
July 29, 2014 at 12:29 am #297077Hi!
Review your site now.
Best regards,
JosueJuly 29, 2014 at 4:24 am #297132You rock, thanks a million!! When I do updates, will I lose what you did?
July 29, 2014 at 4:31 am #297134Hey!
You are welcome. No, all these fixes has being applied to the Quick CSS.
Regards,
JosueJuly 29, 2014 at 8:48 pm #297416Great, thank you! Is there a way that the phone number and quote button can float below the main logo when on mobile? Also, I’m having issues with getting my link for the button to work. Sorry for all the questions :S
July 30, 2014 at 5:24 am #297559Hey!
Try adding this code to the Quick CSS:
div#header_main_alternate { z-index: 10; } @media only screen and (max-width: 767px) { div#header_main_alternate { display: block; } div.logo-text { top: 0; left: 0; font-size: 0; } #header_main_alternate .avia-button-wrap { top: -6px; left: 0px; } #header { height: 120px; } }
Cheers!
JosueJuly 30, 2014 at 5:44 am #297564Awesome, the only thing is that the phone number doesn’t show. Argh I am so sorry for all the questions!
July 30, 2014 at 5:47 am #297566I disabled it on the code because i don’t think it would fit, you can change it though, modify this part:
div#header_main_alternate { display: block; } div.logo-text { top: 0; left: 0; font-size: 0; /* Remove this */ } #header_main_alternate .avia-button-wrap { top: -6px; left: 0px; } #header { height: 120px; /* Increase this number to increase the header size */ }
Cheers!
JosueJuly 30, 2014 at 5:52 am #297568Oh I see! I think I prefer to just have the phone number, rather than the quote on mobile, since that makes it easier for people to call :). You must be in a different time zone than me, or else you’re working much too late :) Thanks so much for your help :)
July 30, 2014 at 6:28 am #297580Use this code instead:
div#header_main_alternate { z-index: 10; } @media only screen and (max-width: 767px) { div#header_main_alternate { display: block; } div.logo-text { top: 0; left: 0; } #header_main_alternate .avia-button-wrap { display: none; } #header { height: 120px; } }
Best regards,
Josue -
AuthorPosts
- The topic ‘Adding Phone Number text and button to Main Header’ is closed to new replies.