Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1046221

    is there a magic add_filter thingy that allows me to do that? :-P my php copying skill are great.. but my php writing skills not so much
    I want to open a modal window with a certain plugin when I click the logo and it only allows me to do that with an added css class..

    (I found how to replace the logo link in another topic)

    #1046226

    do you want it on the img itself or as an additional class to the span.logo ( this contains the link and the logo img) ?

    if you like to have it on the img itself you can add this to your child-theme functions.php:

    function add_class_to_logo_img(){
    ?>
    <script>
    (function($){
          $('.logo img').addClass('custom-class');
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'add_class_to_logo_img');

    PS: by the way, the function name is arbitrary, but I always advise you to choose meaningful names, so that you remember afterwards what the code was still for.

    #1046227

    Hi,

    Please refer to this post – https://kriesi.at/documentation/enfold/logo/#text-logo-with-subtext

    You could use the code as following

    //-------------------------------
    // function - Text Logos
    //-------------------------------
    add_filter('avf_logo_final_output', 'avf_text_logo_final_output');
    
    function avf_text_logo_final_output($logo) {
      $link     = apply_filters('avf_logo_link', home_url('/'));
      $logotext = "<img src='LOGO-LINK-HERE' />";
      $logo     = "<span class='logo custom-class'><h1><a href='".$link."'>".$logotext."</a></h1></span>";
    
      return $logo;
    }

    Cheers!
    Yigit

    #1046228

    Oh yes – i didn’t read that: “I found how to replace the logo link in another topic”
    so you can do it in that combination Yigit does.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.