Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #898507

    Hi, I hope you can help. I have a header that has three additional graphics added to it. I did this by adding custom content to the functions.php file in my Child Theme.

    Unfortunately one of the graphics needs to be a link to another website and one is an email link. When I try to add an HTML link to the src=”image-path” in the functions.php file the site breaks completely and you just see a white screen. Can you tell me how I make these additional header images clickable?

    Thanks for your help.
    D

    #898516

    can you post the code you inserted in functions.php ?
    if you want to obfuscate your url set in f.e. //homeurl/… or something like that

    #898518

    Hi, thanks for getting back to me so quickly. Really appreciated. Here is the code which works fine though the links have been removed in order to allow the rest of the site to work. Please feel free to add some links to something like example.com as the site is not live yet. I have given you the FTP info as well.

    Thanks again,
    John

    <?php

    /*
    * Add your own functions here. You can also copy some of the theme functions into this file.
    * WordPress will use those functions instead of the original functions then.
    */

    function after_head_image_func(){
    echo “<div class=’custom_content’></div>”;
    echo “<div class=’custom_content2′></div>”;
    echo “<div class=’custom_content3′></div>”;
    }

    add_action(‘ava_after_main_menu’, ‘after_head_image_func’);

    #898946

    can you post that with code function here – if you use that little “code” tag above the code is visible at all without beeing changed by board soft.
    Or do you like to have the link on the whole inner content?

    you can use than: <div class="custom_content"><a href='#' target='_blank'>Custom Content</a></div>

    so how to use: click code on top of the editor window – insert your code and press after that the closing code tag
    or insert your code – activate the whole code with your mouse as if you like to copy it – press once the code button.

    #899111

    Thanks Guenni, I’ve attached the FTP info as well in the initial email in case you need to look at the file yourself. Please see below:

    <?php
    
    /*
    * Add your own functions here. You can also copy some of the theme functions into this file. 
    * WordPress will use those functions instead of the original functions then.
    */
    
    function after_head_image_func(){
    	echo "<div class='custom_content'><img src='//homeurl//wp-content/uploads/2018/01/telephone.png'></div>";
    		echo "<div class='custom_content2'><img src='//homeurl//wp-content/uploads/2018/01/email.png'></div>";
    		echo "<div class='custom_content3'><img src='//homeurl//wp-content/uploads/2018/01/zl-group.png'></div>";
    }
    
    add_action('ava_after_main_menu', 'after_head_image_func');
    
    #899701

    maybe this way:

    function after_head_image_func(){
    	echo "<div class='custom_content'><a href='tel:+12345'><img src='//homeurl//wp-content/uploads/2018/01/telephone.png'></a></div>";
    	echo "<div class='custom_content2'><a href='mailto: (Email address hidden if logged out) '><img src='//homeurl//wp-content/uploads/2018/01/email.png'></a></div>";
    	echo "<div class='custom_content3'><a href='url' target='_blank'><img src='//homeurl//wp-content/uploads/2018/01/zl-group.png'></a></div>";
    }
    add_action('ava_after_main_menu', 'after_head_image_func');

    remove the blank target if you like

    #899704

    Thanks Guenni that’s worked a treat! Brilliant work, cheers!!!

    All the best.
    D.

    #900223

    Hi,

    Glad we could help!
    Please take a moment to review our theme and show your support https://themeforest.net/downloads
    To know more about enfold features please check – http://kriesi.at/documentation/enfold/
    Thank you for using Enfold :)

    Best regards,
    Basilis

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Links in header question’ is closed to new replies.