Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1344121

    Hi I need to build an header like this, with 3 logos:
    1) the main on the left
    2) e 3) on the right (they need to be clickable).

    Like this.

    I followed this guide with no success (chapter “Add multiple logos”), put this code in my child functions.php:

    -------------------------------
    Remove the logo
    -------------------------------
    
    add_filter('avf_logo_final_output', 'avia_remove_default_logo', 10, 6);
    function avia_remove_default_logo($logo, $use_image, $headline_type, $sub, $alt, $link){
    return '';
    }
    
    -------------------------------
    Additional Logos
    -------------------------------
    function add_logos($logo) {
      if(is_page(home)){
    
      $logo .= '<a class="first-logo" href="/"><img src="http://rivista-toscana-medica.local/wp-content/uploads/2022/03/logo-rivista.jpg"/></a>';
      $logo .= '<a class="second-logo" href="https://toscanamedica.org"><img src="http://rivista-toscana-medica.local/wp-content/uploads/2022/03/logo-ordine.jpg"/></a>';
      $logo .= '<a class="third-logo" href="https://www.pacinimedicina.it"><img src="http://rivista-toscana-medica.local/wp-content/uploads/2022/03/pacinimedicina.png"/></a>';
      }
      return $logo;
    }
    add_filter('avf_logo_final_output', 'add_logos');

    But having this php error:

    (! ) FATAL ERROR: UNCAUGHT ERROR: UNDEFINED CONSTANT “HOME” IN /USERS/NIGULI/LOCAL SITES/RIVISTA-TOSCANA-MEDICA/APP/PUBLIC/WP-CONTENT/THEMES/ENFOLD-CHILD/FUNCTIONS.PHP ON LINE 21

    What am I doing wrong?
    Line 21 is:
    if(is_page(home)){

    So does the code not recognize which is the homepage? why? Thanks for helping me.

    #1344210

    hi, any help from someone?

    #1344214

    Hi,
    Thanks for your patience, you need to use either if ( is_home() ) { or if ( is_front_page() ) { I believe is_front_page() is the correct one.

    Best regards,
    Mike

    #1344280

    if ( is_front_page() ) {

    worked for me. Thanks Mike, very precious.

    UPDATE: I need the 3 logos in all pages. Now I’m having them only on the front page.
    Can you help me to modify the php function?

    • This reply was modified 2 years, 8 months ago by niguli.
    #1344282

    Hi,
    Glad we were able to help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘3 logos’ is closed to new replies.