Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #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.

    #241657

    I 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/

    #242582

    Hey!

    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,
    Peter

    #242969

    Totally 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
    #243156

    Hey!

    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!
    Ismael

    #243269

    Thank 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.

    #243285

    Hey 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

    #243290

    #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>';

    #243299

    If 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 106

    Copied 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.
    #243317

    Sure, 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>';
    #243339

    Yeah exactly where mine is not sure why it isnt working then :(

    #244263

    Hi!

    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,
    Peter

    #244365

    Dude,
    Updated my enfold which updated helper.. etc etc re’added code worked first time.
    Thank you to everyone for there help.

Viewing 14 posts - 1 through 14 (of 14 total)
  • The topic ‘Header adding images resize’ is closed to new replies.