How do I add a script to theme?

Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #16718
    Ianclaytonianclayton
    Member

    Hi There

    I need to add a chat widget from my remote support site – how and where do I add the code?

    Here is the code:

    <!– DeskPRO Chat –>
    <script type=”text/javascript”>
    var DpChatWidget_Options = DpChatWidget_Options || {};
    DpChatWidget_Options.startPhrase = ‘Click here to chat with us’;
    DpChatWidget_Options.tabLocation = ‘right’;

    DpChatWidget_Options.openInWindowPhrase = ‘Open this chat in a new window’;
    DpChatWidget_Options.resumePhrase = ‘Open your chat’;
    DpChatWidget_Options.languageId = 0;

    /**
    * Specify department IDs that should be the only options the user can select.
    * Note: If only one department is available, the Department field will be hidden completely.
    */
    //DpChatWidget_Options.onlyShowDepartments = [];

    /**
    * Style for the chat button
    */
    DpChatWidget_Options.btnStyle = {
    bgColor: ‘#3F3F3F’,
    border: ‘2px solid #727272’,
    textColor: ‘#FFFFFF’,
    textShadow: ‘0px 1px 2px #000000’,
    font: ‘bold 12px Arial, sans-serif’
    },

    /**
    * Style for the chat border/frame that goes
    * around the chat window.
    */
    DpChatWidget_Options.frameStyle = {
    bgColor: ‘#2A69A9’,
    textColor: ‘#FFFFFF’
    };

    DpChatWidget_Options.protocol = (‘https:’ == document.location.protocol ? ‘https’ : ‘http’);
    DpChatWidget_Options.deskproUrl = DpChatWidget_Options.protocol + ‘://sm101.deskpro.com/’;
    DpChatWidget_Options.currentPageUrl = window.location;
    DpChatWidget_Options.referrerPageUrl = document.referrer;
    if (document.getElementsByTagName) {
    (function() {
    var scr = document.createElement(‘script’);
    scr.type = ‘text/javascript’;
    scr.async = true;
    scr.src = DpChatWidget_Options.protocol + ‘://sm101.deskpro.com/web/javascripts/DeskPRO/User/ChatWidget/ChatWidget.js’;
    (document.getElementsByTagName(‘head’)[0] || document.getElementsByTagName(‘body’)[0]).appendChild(scr);
    })();
    }
    </script>
    <!– /DeskPRO Chat –>

    #16736
    RaghavendraRaghavendra
    Moderator

    Try this –

    function print_my_inline_script() {
    ?>
    
    
    
    		
    	
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Invent Theme Support’ is closed to new topics and replies.