I have the [[LINK href="http://fthrwght.com/highart/"]]High Art Pro[[/LINK]] theme installed on my wordpress, and actually runs perfectly, but infinite scroll is giving me problems and all the error i get is Uncaught TypeError: Object [object Object] has no method 'infinitescroll' www.trashfact.com:803
You can check the blog here http://trashfact.com and it should be working on the Archive part of the theme among others.
I would like to find the typeError, and that's all.
Thank You very much in advance !!!
<strong>UPDATE 1</strong>: Infinite Scroll is loaded on the footer
<strong>UPDATE 2</strong>: Thanks Dbranes, any idea why not loading automatically with this code?¿ i have embeded manually, And images are not loading....
// Use Infinite Scroll when turned on and on Blog, Archive and Exhibit Templates only
if ( $ha_infinite_scroll == '1' && ( is_page_template( 'ha-blog-archive-page.php' ) || is_page_template( 'ha-exhibits-archive-page.php' ) || is_page_template( 'ha-events-archive-page.php' ) || is_home() || is_archive() || is_page_template( 'ha-full-archive-page.php' ) ) )
wp_enqueue_script('infinite-scroll', TEMPLATE_DIR . '/js/jquery.infinitescroll.min.js', array('jquery'), '2.0b1.110420' );
wp_enqueue_script('highart', TEMPLATE_DIR . '/js/jquery.highart.js', array('jquery'), '0.0.13' );
}
}
add_action('wp_print_scripts', 'ha_enqueue_scripts');
Dbranes answers:
Your javascript file is not loaded i.e.
plugins/infinite-scroll/js/front-end/jquery.infinitescroll.js
hmm... looks like you are not using this plugin at all ;-)
Dbranes comments:
the reason why you get
<blockquote>Uncaught TypeError: Object [object Object] has no method 'infinitescroll'</blockquote>
is that you are using
$infinitemasonry.infinitescroll({...});
in the footer but you don't have this method defined.
So you need to install the Infinite-scroll plugin and make sure you have this file loaded:
<script type='text/javascript' src='http://www.trashfact.com/wp-content/plugins/infinite-scroll/js/front-end/jquery.infinitescroll.js'></script>
on your archive page.
Dbranes comments:
do you have
$ha_infinite_scroll = '1';
defined before the if sentence?
Dbranes comments:
ps: you might also want to replace
TEMPLATE_DIR
with
get_template_directory_uri()
Trashfunkel comments:
Yes $ha_infinite_scroll = '1'; was defined before, sent you PM