1

When implementing Jet Pack for wordpress infinite scroll, my dev/staging server throws this error and wont load the next posts. However, locally it works fine, posts load normally and no console error. I've looked for open tags, and attempted to reorganize a few function calls however, the console always throws an unexpected token error for the first character in the header.php. I swear at one point it was working on the live dev/staging server but I could be mistaken.

Uncaught SyntaxError: Unexpected token <

enter image description here

This is my Init for Infinite Scroll

// Add Infinite Scroll

function elevator_infinite_scroll_init() {
    add_theme_support( 'infinite-scroll', array(
    'type' => 'click',
    'container' => 'content',
    'render' => 'elevator_infinite_scroll_render',
    'footer' => false,
    'wrapper' => false,
    'posts_per_page' => '9',
    ));
}
add_action( 'init', 'elevator_infinite_scroll_init' );

function elevator_infinite_scroll_render() {
    get_template_part( 'more-content');
}

testing for any plugin conflicts now

1
  • seems like it might be a problem with yoast SEO, disabling that plugin fixes the problem, however I'm kind of relying on the plugin at the moment
    – Bryan
    Commented Dec 14, 2015 at 22:25

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.