Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1239071

    Moussa
    Participant

    Hello,

    I have to insert a code in the header tag.

    The documentation states that i should have a x child theme installed. I have done that.

    I am trying to look the header.php file located in the global folder under framerwork. But the file is empty. Any help here?

    thanks

    #1239074

    benjahmen
    Participant

    Hi Moussa,

    I am not ThemeCo but a fellow X Theme user so if i am incorrect please wait for ThemeCo Staff to respond, however hope the below helps!

    You will need to copy the file _navbar.php which is under “/x/framework/views/global/” into your child theme’s respective location (/x-child/framework/views/global/).

    Then try adding your content below code.
    <?php x_get_view( ‘global’, ‘_nav’, ‘primary’ ); ?>

    #1239139

    Thai
    Moderator

    Thanks for sharing @benjahmen.

    @moussa-rifai: If it doesn’t work, would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – Link to your site
    – WordPress Admin username / password
    – FTP credentials

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    Thanks.

    #1239593

    Moussa
    Participant
    This reply has been marked as private.
    #1239612

    Moussa
    Participant
    This reply has been marked as private.
    #1239774

    Jade
    Moderator

    HI Moussa,

    Please add this code in the functions.php file of the child theme:

    add_action('wp_head', 'load_head_code');
    
    function load_head_code() {
    
    ?>
         <link rel="manifest" href="/manifest.json">
    
         <script type="text/javascript" src="//cdn.pushwoosh.com/webpush/pushwoosh-web-notifications.js" async></script>
         <script type="text/javascript">
              var Pushwoosh = Pushwoosh || [];
                  Pushwoosh.push(['init', {
                  logLevel: 'info', // or debug
                  applicationCode: 'DEAD0-BEAF0',
                  safariWebsitePushID: 'web.com.example.domain',
                  defaultNotificationTitle: 'Pushwoosh',
                  defaultNotificationImage: 'https://cp.pushwoosh.com/img/logo-medium.png'
              }]);
         </script>
    <?php
    }

    Let us know how it goes.

    #1240958

    Moussa
    Participant

    Do i delete the _header.php I created?

    #1241116

    Jade
    Moderator

    HI Moussa,

    Yes, you may get rid of the file you have created if the code provided previously sorts it out but keep a copy of the file, just in case you’ll need it.

    Thank you.

    #1241456

    Moussa
    Participant

    Thanks. I have done so..

    I would aslo like to include a code for tracking by mix panel.

    Should i add that to the same file or what do you recommed?

    the code is:

    <!– start Mixpanel –><script type=”text/javascript”>(function(e,a){if(!a.__SV){var b=window;try{var c,l,i,j=b.location,g=j.hash;c=function(a,b){return(l=a.match(RegExp(b+”=([^&]*)”)))?l[1]:null};g&&c(g,”state”)&&(i=JSON.parse(decodeURIComponent(c(g,”state”))),”mpeditor”===i.action&&(b.sessionStorage.setItem(“_mpcehash”,g),history.replaceState(i.desiredHash||””,e.title,j.pathname+j.search)))}catch(m){}var k,h;window.mixpanel=a;a._i=[];a.init=function(b,c,f){function e(b,a){var c=a.split(“.”);2==c.length&&(b=b[c[0]],a=c[1]);b[a]=function(){b.push([a].concat(Array.prototype.slice.call(arguments,
    0)))}}var d=a;”undefined”!==typeof f?d=a[f]=[]:f=”mixpanel”;d.people=d.people||[];d.toString=function(b){var a=”mixpanel”;”mixpanel”!==f&&(a+=”.”+f);b||(a+=” (stub)”);return a};d.people.toString=function(){return d.toString(1)+”.people (stub)”};k=”disable time_event track track_pageview track_links track_forms register register_once alias unregister identify name_tag set_config reset people.set people.set_once people.increment people.append people.union people.track_charge people.clear_charges people.delete_user”.split(” “);
    for(h=0;h<k.length;h++)e(d,k[h]);a._i.push([b,c,f])};a.__SV=1.2;b=e.createElement(“script”);b.type=”text/javascript”;b.async=!0;b.src=”undefined”!==typeof MIXPANEL_CUSTOM_LIB_URL?MIXPANEL_CUSTOM_LIB_URL:”file:”===e.location.protocol&&”//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js”.match(/^\/\//)?”https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js”:”//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js”;c=e.getElementsByTagName(“script”)[0];c.parentNode.insertBefore(b,c)}})(document,window.mixpanel||[]);
    mixpanel.init(“77a6444df9a5ddf897139b50d74db3b5”);</script><!– end Mixpanel –>

    #1241866

    Darshana
    Moderator

    Hi there,

    You can add another code in the same way as the above example.

    
    add_action('wp_head', 'my_mixpanel_tracking');
    
    function my_mixpanel_tracking() {
    
    ?>
         
         <script type="text/javascript">
              // Your Code Here
         </script>
    <?php
    }
    

    Hope that helps.