Jump to content

Archived

This topic is now archived and is closed to further replies.

triggerfish

TRying to get a line of Script in header, but high up

Recommended Posts

triggerfish

Hi,

I am trying to get a line of Script in header, but high up in the header.

It is for adaptive images and requires a high up placement in the header.

For some reason I cannot get it to place high with your header script.

I have tried it in the DMS interface, add custom script as well as inserting it into the actual header.php file with no luck.

 

You can see it here at the bottom of all the scripts (in bold)...

<!-- Scripts -->
<link rel="shortcut icon" href="http://triggerfishhost.com/wp-content/themes/dms/dms/images/default-favicon.png"type="image/x-icon" />
<link rel="profile" href="http://gmpg.org/xfn/11"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<meta property='pl-share-title' content='Home' />
<meta property='pl-share-url' content='http://triggerfishhost.com/'/>
<meta property='pl-share-desc' content='THIS WEBSITE IS CURRENTLY UNDER CONSTRUCTION New Triggerfish.Gold Hosting &amp; Optimization Packages Google and many [...]' />
<meta property='pl-share-img' content='' />
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://triggerfishhost.com/xmlrpc.php?rsd"/>
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://triggerfishhost.com/wp-includes/wlwmanifest.xml"/> 
 
<link rel='shortlink' href='http://triggerfishhost.com/'/>
<script type="text/javascript">
jQuery(document).ready(function() {
// CUSTOM AJAX CONTENT LOADING FUNCTION
var ajaxRevslider = function(obj) {
 
// obj.type : Post Type
// obj.id : ID of Content to Load
// obj.aspectratio : The Aspect Ratio of the Container / Media
// obj.selector : The Container Selector where the Content of Ajax will be injected. It is done via the Essential Grid on Return of Content
 
var content = "<h2>THIS IS SOME TITLE</h2><br/>";
 
content += "Type:"+obj.type+"</br>";
content += "ID:"+obj.id+"</br>";        
content += "Aspect Ratio:"+obj.aspectratio+"</br>";  
 
data = {};
 
data.action = 'revslider_ajax_call_front';
data.client_action = 'get_slider_html';
data.token = '3934a40a98';
data.type = obj.type;
data.id = obj.id;
data.aspectratio = obj.aspectratio;
 
// SYNC AJAX REQUEST
jQuery.ajax({
type:"post",
dataType: 'json',
data:data,
async:false,
success: function(ret, textStatus, XMLHttpRequest) {
if(ret.success == true)
content = ret.data;
},
error: function(e) {
console.log(e);
}
});
 
// FIRST RETURN THE CONTENT WHEN IT IS LOADED !!
return content;
};
 
// CUSTOM AJAX FUNCTION TO REMOVE THE SLIDER
var ajaxRemoveRevslider = function(obj) {
return jQuery(obj.selector+" .rev_slider").revkill();
}
 
// EXTEND THE AJAX CONTENT LOADING TYPES WITH TYPE AND FUNCTION
var extendessential = setInterval(function() {
if (jQuery.fn.tpessential != undefined) {
clearInterval(extendessential);
if(typeof(jQuery.fn.tpessential.defaults) !== 'undefined')
jQuery.fn.tpessential.defaults.ajaxTypes.push({type:"revslider",func:ajaxRevslider,killfunc:ajaxRemoveRevslider,openAnimationSpeed:0.3});   
// type:  Name of the Post to load via Ajax into the Essential Grid Ajax Container
// func: the Function Name which is Called once the Item with the Post Type has been clicked
// killfunc: function to kill in case the Ajax Window going to be removed (before Remove function !
// openAnimationSpeed: how quick the Ajax Content window should be animated (default is 0.3)
}
},30);
});
</script>
<style type="text/css">.recentcomments a{display:inline !important;padding:0 !important;margin:0 !important;}</style>
<script type="text/javascript">
(function(url){
if(/(?:Chrome\/26\.0\.1410\.63 Safari\/537\.31|WordfenceTestMonBot)/.test(navigator.userAgent)){ return; }
var wfscr = document.createElement('script');
wfscr.type = 'text/javascript';
wfscr.async = true;
wfscr.src = url + '&r=' + Math.random();
(document.getElementsByTagName('head')[0]||document.getElementsByTagName('body')[0]).appendChild(wfscr);
})('//triggerfishhost.com/wp-admin/admin-ajax.php?action=wordfence_logHuman&hid=D09525A24648141B8B6A8DFEF617AA24'); 
</script>
<!-- On Ready -->
<script> /* <![CDATA[ */
!function ($) {
jQuery(document).ready(function() {
})
}(window.jQuery);
/* ]]> */
</script>
 
<script>document.cookie='resolution='+Math.max(screen.width,screen.height)+'; path=/';</script>
 
Is there anyway to get this at the top of the scripts?
 
Thx

Share this post


Link to post
Share on other sites
Danny

Hi,

 

You will ned to use the wp_head function via a hook and change the priority, see here for more info -http://wordpress.stackexchange.com/questions/98771/wp-head-list-hooked-actions-with-priorities

If you're still having issues, you will want to ask this question on the WordPress support forums.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites

  • Similar Content

    • Paul
      By Paul+
      I was surprised to see I had no menu today - out of the blue - its actually moved to the bottom of the page!  After hours of fiddling and disabling every single plugin, leaving just plagelines the issue is still present.  See video for a basic text box - I moved it into the head and it jumps to the bottom and shows just above the footer but below the main content.  I have a temp fix by placing the menu into the first row on the main content but it does mean other than my home page, all other pages have no menu.  A quick fix is very urgent for this bug.
      https://thelaptopfixers.com
       
       
    • russe-intensif
      By russe-intensif+
      Hi team,
      checking my site today, i'm surprised to see my MegaNav all in bottom of the pages, while it's in header.
      After getting to change it in couple of pages onto Template part (too time consuming !), i'm desperate and ask you for help :-)
      apprendre-le-russe-avec-ania.fr
      Thank you in advance !

    • flourishdesignstudio
      By flourishdesignstudio+
      Hello,
      I have an older site that was built using PageLines several years ago (prior to the release of DMS). I wanted to leverage some of the power of your new PL5 plugin but the theme prevents be from adding any generated custom sidebars to the theme (through the drag and drop interface) and does not allow me to add any PL5 sections/containers/etc to the header or footer. Is there any way to easily override that or am I stuck only using PL5 in the content areas of the site?
      Thanks so much for the help!
    • JP
      By JP+
      Hello,
      How can you set the translations with platform5, the parts that are not in pages or posts? Texts and images…
    • romanondrasek
      By romanondrasek+
      hi all, I have some trouble using PL5 on my site. 
      I used plugins for event calendar (event on) and plugin (timetable responsive scheduler for WP) for schedule (classes) in the gym.
      The problem is, that post from this 2 plugins are shown without menu in header and footer. (I setup header and footer) in the page editor for all type of page. 
      When I create a lesson, it creates posts with slug (I have a slug "lekce" & event for events).
      I try to edit the post with PL editor, but editor is not opening on the post.

      Do you have some idea where should be some problem? Thanx so much.
      here are links for the sites :
      site with schedule :
      http://www.myfit.cz/rozvrh/
      site of one of the class (pilates)
      http://www.myfit.cz/lekce/pilates/
      site with calendar :
      http://www.myfit.cz/kalendar/
      7 side with one event from the calendar :
      http://www.myfit.cz/event/pilates-instruktor-akreditovana-licence/?ri=1
      when I have my site on DMS2 it was working :-(
       
       
×