-
AuthorPosts
-
September 1, 2014 at 7:57 pm #311980
Is there some way to insert a banner, image or written text into the main header to fill some of the empty space opposite the logo? I thought I could insert a widget but there is no header option in the widgets. Any assistance would be much appreciated!
http://tangerinefox.com/landscapemate/
- This topic was modified 10 years, 3 months ago by Josue.
September 2, 2014 at 8:48 am #312111Hey pachanights!
Thank you for using Enfold.
You can use this on functions.php if you want to insert an extra element anywhere on the header:
function ava_extra_header_element() { ?> ADD ANY CONTENT HERE! <?php } add_action('ava_main_header', 'ava_extra_header_element');
Cheers!
IsmaelSeptember 2, 2014 at 10:31 am #312176I not see this text in this file
September 2, 2014 at 11:57 am #312212September 2, 2014 at 4:26 pm #312380I don’t see this code in the functions.php file either, unless I’m looking at the wrong one. Whats the path to be sure?
I was hoping to be able to add something into the the quick css to give the same result. Is this possible?
September 2, 2014 at 4:35 pm #312386Hey!
You should go to Appearance > Editor and open functions.php file and add the code Ismael posted and change “ADD ANY CONTENT HERE!” with HTML code of your content as following
function ava_extra_header_element() { ?> <div class='my-custom-content'>Here goes my text!</div> <?php } add_action('ava_main_header', 'ava_extra_header_element');
Regards,
YigitSeptember 2, 2014 at 5:50 pm #312439Ahh! thank you for explaining, and for the code. I’ve got it working now
September 2, 2014 at 5:53 pm #312440One last question….is there something I can add to the custom css to allow me to change the position, font size, colour etc?
September 2, 2014 at 6:07 pm #312446Hi!
Please add following code to Quick CSS and adjust as needed
.my-custom-content { position: relative; left: 50px; color: red; font-size: 18px; }
Cheers!
YigitSeptember 2, 2014 at 7:18 pm #312469novaproject.ru
September 2, 2014 at 7:42 pm #312475Help!!!! can’t understand where to insert this code, put in one place and the text appeared above the logo and not the right of it
September 2, 2014 at 7:52 pm #312481Thank you Yigit! Brilliant help, as always :)
September 2, 2014 at 8:03 pm #312484functions.php show me place
EDITED //
September 2, 2014 at 10:09 pm #312518Hi!
@pachanights You are welcome :)
@alexrvs after adding the code to Functions.php file you should adjust its position using the code i posted here – https://kriesi.at/support/topic/display-a-banner-or-written-info-in-header/#post-312446Cheers!
YigitSeptember 3, 2014 at 5:49 am #312628if I could do it I would not have to ask the questions what and how
September 3, 2014 at 5:57 am #312633ok i now try? read text about position: relative may be i can
September 3, 2014 at 6:10 am #312639September 3, 2014 at 6:15 am #312642Tell me it may be easier to disable the cap ? and instead collect of the blocks that I need ? I tried to disable the cap but this changes the width of the website on full
September 3, 2014 at 6:21 am #312644Hi!
Thank you for the update.
Please replace the css snippet with this:
.my-custom-content { position: absolute; left: 330px; top: 20px; color: red; font-size: 18px; } .header-scrolled .my-custom-content { display: none; }
Cheers!
IsmaelSeptember 3, 2014 at 6:22 am #312645September 3, 2014 at 6:33 am #312650add in extra info
September 3, 2014 at 6:39 am #312655September 3, 2014 at 6:44 am #312657now good
scrool down
September 3, 2014 at 6:47 am #312659September 3, 2014 at 7:14 am #312669i make
position: absolute;
left: 30%;
top: 3%;but now need make and small font in small window
September 4, 2014 at 9:55 am #313224Hi,
This was perfectly just on time support. I was about to ask the same question on how to get text into the header. Thanks to your superb help/advice it works like a dream. Great!A question though. If I have a bilingual site, how will I get different language versions? I am planning on using WPML. Will that solve my problem, since the text is in the functions.php file? Or is there any other way to do this so that it can be handled easily on a bilingual site?
Cheers,
RainerSeptember 5, 2014 at 10:39 am #313900Hi!
Probably the easiest solution would be to use the constant to check the current language. Use it like:
function ava_extra_header_element() { $banner = "<div class='my-custom-content'>Here goes my text for the standard language!</div>"; if(defined('ICL_SITEPRESS_VERSION') && defined('ICL_LANGUAGE_CODE')){ if(ICL_LANGUAGE_CODE == "de") $banner = "<div class='my-custom-content'>Here goes my text for the German language!</div>"; if(ICL_LANGUAGE_CODE == "en") $banner = "<div class='my-custom-content'>Here goes my text for the Spanish language!</div>"; } } add_action('ava_main_header', 'ava_extra_header_element');
Replace de and en with the language shortcode(s) of your “translated” language(s) and change the “Here goes my text for the German language!”, etc text strings accordingly. Then replace “Here goes my text for the standard language!” with the text/banner of your “main” language (i.e. English).
Cheers!
PeterSeptember 5, 2014 at 11:16 am #313938Thanks! I’ll try that when I start with the language versions.
Rainer
-
AuthorPosts
- The topic ‘Insert a banner or written info into the header’ is closed to new replies.