ThemeShaper Forums » Thematic

[closed]

Front page not recognized as such... effecting conditional abilites

(3 posts)
  • Started 3 years ago by NED
  • Latest reply from NED
  • This topic is resolved
  1. NED
    Member

    HI,
    I have scoured the forums and wp to try and figure out what is going on but I cannot seem to get my functions file to recognize my static front page as such... I have followed the instructions thru wordpress > created an empty home page, gave the proper template name, built the template page and it loads fine and everything is great when viewing the home page, the problem is when I try to conditionally load some js scripts from within the functions file... here's my code but it doesn't work, any thoughts much obliged, thx ;)

    // conditionally Load js callz...
    if ( is_front_page() ) {
    function add_js_calls() {  ?>
    
    	<script type="text/javascript">
    	jQuery(document).ready(function() {
    		jQuery('#topic-scrollpane').jScrollPane();
    
    		jQuery('#slider').s3Slider({timeOut: 9000});
    
    	});
    	</script>
    
     <?php }
    add_action('wp_head','add_js_calls');
    }
    Posted 3 years ago #
  2. i put this in the other thread. your function/conditional logic is out of order. try this:

    // conditionally Load js callz...
    
    function add_js_calls() {
       if ( is_front_page() ) {?>
    
    	<script type="text/javascript">
    	jQuery(document).ready(function() {
    		jQuery('#topic-scrollpane').jScrollPane();
    
    		jQuery('#slider').s3Slider({timeOut: 9000});
    
    	});
    	</script>
    
     <?php } }
    add_action('wp_head','add_js_calls');
    Posted 3 years ago #
  3. NED
    Member

    doh! i could of sworn I tried that but that worked like a charm... thx for quik response ;)

    Posted 3 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.