-
AuthorPosts
-
March 21, 2014 at 2:59 pm #241196
Hi guys,
I’m interested in finding out how I am able to add images to my header. so when it re sizes all the images
do the same as the logo and downscale in size.March 22, 2014 at 6:51 pm #241657I want to do the same thing – I’ve just posted for help in another topic that is related:
https://kriesi.at/support/topic/header-adding-images-resize/
March 25, 2014 at 9:18 am #242582Hey!
I suggest to wrap your image into a div and then add a custom class to this div. I.e. like:
<div class="my_custom_img"><img src="http://website.com/my_img.jpg" alt="" /></div>
Then open up enfold/js/avia.js and replace:
var logo = $('#header_main .container .logo img, #header_main .container .logo a'),
with
var logo = $('#header_main .container .logo img, #header_main .container .logo a, #header_main .container .my_custom_img img'),
Best regards,
PeterMarch 25, 2014 at 8:21 pm #242969Totally confused. Tried putting:
<div class="free-shipping"><img src="/wp-content/uploads/2014/03/free-shipping.png" alt="Free Shipping" /></div>
under
"echo avia_logo(AVIA_BASE_URL.'images/layout/logo.png', $addition, 'strong', true);"
as indicated in this thread https://kriesi.at/support/topic/add-image-or-text-at-top-of-homepage-between-top-logo-and-menu-on-right/, plus editing the .js file as you mention above, but it simply broke the site.
If I remove the div from the “helper-main-menu.php” file, then the site comes back, so obviously it’s this edit that’s causing problems.
Could you point out what I’m doing wrong please?
- This reply was modified 10 years, 8 months ago by adapt. Reason: to make sure code shows up correctly
March 26, 2014 at 6:23 am #243156Hey!
Please edit the code like this:
echo '<div class="my_custom_img"><img src="/wp-content/uploads/2014/03/free-shipping.png" alt="Free Shipping" /></div>';
Follow Dude’s instruction regarding the js file.
Cheers!
IsmaelMarch 26, 2014 at 11:20 am #243269Thank you for replys guys, I checked my account I thought i was going crazy I knew i posted this and it said i hadn’t posted. much appreciated cheers.
March 26, 2014 at 11:58 am #243285Hey iv done as you said, doesn’t seem to be re sizing with the logo. seen another thread where it tells you about the helper-main-menu.php file iv tried altering that.
echo avia_logo(AVIA_BASE_URL.'images/layout/logo.png', $addition, 'strong', true); echo "<div class='logo_addition' style='position: absolute; top: 87px; left: -12px; float:left; z-index: 3;'><img src='leafoverlay.png' /></div>"; echo "<div class='logo_addition' style='position: absolute;right:0 ; z-index: 4; image-rendering: auto; display:block; width: 409px; height: 155px;'><img src='carbonheader.png' /></div>";
also added .logo_addition to the java file
if(!header.length) return; var logo = $('#header_main .container .logo img, #header_main .container .logo a, #header_main .container .logo_addition img'),
Dont see where im going wrong
March 26, 2014 at 12:06 pm #243290March 26, 2014 at 12:15 pm #243296@corepart – I don’t know if it makes a big difference, but you’ve got your parenthesis and apostrophe’s in the opposite order. You have:
echo "<div class='logo_addition' style='position: absolute; top: 87px; left: -12px; float:left; z-index: 3;'><img src='leafoverlay.png' /></div>"; echo "<div class='logo_addition' style='position: absolute;right:0 ; z-index: 4; image-rendering: auto; display:block; width: 409px; height: 155px;'><img src='carbonheader.png' /></div>";
I believe it should be:
echo '<div class="logo_addition" style="position: absolute; top: 87px; left: -12px; float:left; z-index: 3;"><img src="leafoverlay.png" /></div>'; echo '<div class="logo_addition" style="position: absolute;right:0 ; z-index: 4; image-rendering: auto; display:block; width: 409px; height: 155px;"><img src="carbonheader.png" /></div>';
Thanks to your note however I finally managed to get mine working. For future reference, anyone else that wants to put an image in the header (not under the logo though), here’s my code:
echo '<div class="free_shipping" style="position: absolute; top: 20px; left: 400px; float:center; z-index: 3;"><a href="/shipping/"><img src="/wp-content/uploads/2014/03/freeshipping.png" alt="Free Shipping" /></a></div>';
March 26, 2014 at 12:31 pm #243299If I have my parenthesis and apostrophe’s in the other order I get errors on the site.
Parse error: syntax error, unexpected T_STRING, expecting ‘,’ or ‘;’ in public_html/wp-content/themes/enfold/includes/helper-main-menu.php on line 106Copied your code directly and it doesnt through errors now. but still wont resize.
Glad you got yours working :)
Where abouts did you place your code btw? are you able to do a /code for me to show placement? incase its something as simple as that.
- This reply was modified 10 years, 8 months ago by corepart.
March 26, 2014 at 1:27 pm #243317Sure, here’s how mine appears in helper-main-menu.php:
echo avia_logo(AVIA_BASE_URL.'images/layout/logo.png', $addition, 'strong', true); echo '<div class="free_shipping" style="position: absolute; top: 20px; left: 400px; float:center; z-index: 3;"><a href="/shipping/"><img src="/wp-content/uploads/2014/03/freeshipping.png" alt="Free Shipping" /></a></div>';
March 26, 2014 at 2:00 pm #243339Yeah exactly where mine is not sure why it isnt working then :(
March 28, 2014 at 9:36 am #244263Hi!
Try to edit an unmodified version of helper-main-menu.php with a code editor like notepad++ and upload it with ftp (overwrite the old file).
Regards,
PeterMarch 28, 2014 at 2:32 pm #244365Dude,
Updated my enfold which updated helper.. etc etc re’added code worked first time.
Thank you to everyone for there help. -
AuthorPosts
- The topic ‘Header adding images resize’ is closed to new replies.