Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1077769
    leonhoffmann
    Participant

    I followed this thread but it is not working for me: https://community.theme.co/forums/topic/put-a-close-text-link-or-button-in-the-header-widget/

    Also, I want the header widget menu when a user have choosen an language from the dropdown in the header widget.

    My website is: http://www.click-your-ads.com/#

    Many thanks for your help.

    #1078165
    Jade
    Moderator

    Hi there,

    Please use this code:

    (function($){
    
        $("#language_inner .option a").click(function(){
    		if($(".x-widgetbar").hasClass('in')){
    			$('.x-widgetbar').removeClass('in');
    		}
    		else{
    			$('.x-widgetbar').addClass('in');
    			$('.x-widgetbar').css('height', 'auto');
    		}
        });
    
    })(jQuery);

    Hope this helps.

    #1080101
    leonhoffmann
    Participant

    Not working for me. 🙁

    Maybe my questions wasn’t clear. Here again:

    1. I want the header menu widget to be opened when a user clicks on the flags in the menu.

    2. After a user have chosen the language (thats was possible in the header menu widget), I want the header menu to automatically close.

    Could you kindly provide the code for that?

    Many thanks,
    Leon

    #1080108
    Thai
    Moderator

    Hi Leon,

    Please try with this JS instead:

    (function($){
        $("#menu-item-4001 a").click(function(){
    		if( $(".x-widgetbar").hasClass('in') ){
    			$('.x-widgetbar').removeClass('in');
    		} else {
    			$('.x-widgetbar').addClass('in');
    			$('.x-widgetbar').css('height', 'auto');
    		}
        });
        $("#language_inner a.notranslate.nturl").click(function(event) {
        	$('.x-widgetbar').removeClass('in');
        });
    })(jQuery);

    Hope it helps 🙂

    #1080126
    leonhoffmann
    Participant

    No, not working. 🙁

    #1080133
    Christopher
    Moderator

    Hi there,

    Please update your code to :

    (function($){
        $("#menu-item-4001 a").click(function(){
    		if( $(".x-widgetbar.collapse").hasClass('in') ){
    			$('.x-widgetbar.collapse').removeClass('in');
    		} else {
    			$('.x-widgetbar.collapse').addClass('in');
    			$('.x-widgetbar.collapse').css('height', 'auto');
    		}
        });
        $("#language_inner a.notranslate.nturl").click(function(event) {
        	$('.x-widgetbar.collapse').removeClass('in');
        });
    })(jQuery);

    Hope it helps.

    #1080152
    leonhoffmann
    Participant

    Not working. 🙁 Sorry!

    #1080157
    Christopher
    Moderator

    Hi there,

    Please provide us with login credentials in private replay.

    Thanks.

    #1080159
    leonhoffmann
    Participant
    This reply has been marked as private.
    #1080180
    Thai
    Moderator

    Hi There,

    The custom Javascript doesn’t allow script tag, so please delete all your google script & facebook pixel code.

    Instead of adding directly to Custom > Javascript, you can add the following code to the functions.php file locates in your child theme:

    add_action( 'wp_head', 'x_wp_head' );
    function x_wp_head(){
      ?>
      <!-- Google Code for Website Kampagne, Anfrage Conversion Page -->
      <script type="text/javascript">
      /* <![CDATA[ */
      var google_conversion_id = 973681942;
      var google_conversion_language = "en";
      var google_conversion_format = "3";
      var google_conversion_color = "ffffff";
      var google_conversion_label = "gHvpCMDwr1sQluqk0AM";
      var google_remarketing_only = false;
      /* ]]> */
      </script>
      <script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
      </script>
      <noscript>
      <div style="display:inline;">
      <img height="1" width="1" style="border-style:none;" alt="" src="//www.googleadservices.com/pagead/conversion/973681942/?label=gHvpCMDwr1sQluqk0AM&guid=ON&script=0"/>
      </div>
      </noscript>
    
      <script type="text/javascript">
      (function (d, w, c) {
          (w[c] = w[c] || []).push(function() {
              try {
                  w.yaCounter30396567 = new Ya.Metrika({id:30396567,
                          webvisor:true,
                          clickmap:true,
                          trackLinks:true,
                          accurateTrackBounce:true,
                          trackHash:true,params:window.yaParams||{ }});
              } catch(e) { }
          });
    
          var n = d.getElementsByTagName("script")[0],
              s = d.createElement("script"),
              f = function () { n.parentNode.insertBefore(s, n); };
          s.type = "text/javascript";
          s.async = true;
          s.src = (d.location.protocol == "https:" ? "https:" : "http:") + "//mc.yandex.ru/metrika/watch.js";
    
          if (w.opera == "[object Opera]") {
              d.addEventListener("DOMContentLoaded", f, false);
          } else { f(); }
      })(document, window, "yandex_metrika_callbacks");
      </script>
      <!-- /Yandex.Metrika counter -->
    
      <meta name="google-site-verification" content="MeoYDrXJGmnIxs67zejc0Vve5srwqFzV0mRXVpXpORM" />
    
      <!-- Facebook Pixel Code -->
      <script>
      !function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
      n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
      n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
      t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
      document,'script','//connect.facebook.net/en_US/fbevents.js');
    
      fbq('init', '744488628985970');
      fbq('track', "PageView");</script>
      <noscript><img height="1" width="1" style="display:none"
      src="https://www.facebook.com/tr?id=744488628985970&ev=PageView&noscript=1"
      /></noscript>
      <!-- End Facebook Pixel Code -->
      <?php
    }

    Regards!

    #1080191
    leonhoffmann
    Participant

    Great! Now all works. Are you sure the tracking snippets are still working?

    Many, many thanks for the fast and profound support!

    #1080205
    Thai
    Moderator

    Are you sure the tracking snippets are still working?

    Yes, of course.

    If you need anything else please let us know.

    #1080214
    leonhoffmann
    Participant

    Awesome support! Many, many thanks!!!

    #1080218
    leonhoffmann
    Participant

    One last thing. The code you provided is display in the footer… 🙁

    #1080542
    Rad
    Moderator

    Hi there,

    All I could see is cookie message on the footer, would you mind providing a screenshot?

    Thanks!

  • <script> jQuery(function($){ $("#no-reply-1077769 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>