• Resolved Siinex

    (@siinex)


    Hi there,

    just like stated in another dude’s topic I am only getting thos loading cubes, and the console ist printing “Uncaught SyntaxError: Invalid or unexpected token”.

    twitch-js.php
    Firstly spotted here:

    <script type="text/javascript">
    ( function( $ ) {</p>
    var id = "<?php echo $id; ?>";

    The </p>-Tag doesn’t even appear in the code, but there has been a blank space/line break that I removed. When I reloaded the page the error jumped to line 1512 (1513 in original file):

    var html = '<li class="stream"><a target="_blank" href="'+url+'" title="Watch '+display_name+' Now!" data-channel-name='+display_name+'>';

    In the console there is yet again a blank line break, which this time I cannot remove, so I am sitting here wondering what invalid token it could be pointing at.
    In my console it’s showing like this:

    var html = '
    
    <li class="stream"><a target="_blank" href="'+url+'" title="Watch '+display_name+' Now!" data-channel-name='+display_name+'>';
            html += '</p>

    which is not even the stated code in the file. Not the “html += ‘</p>’ part in any case. Yes, it seeme to be the right file, since it reacts to changes I am doing.

    Hope this can help to solve this issue. :>

    Best regards!

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author JayBee

    (@jburleigh1)

    I appreciate the detailed bug report. I believe the issue is WordPress’ auto <p>, and I know the solution but it’s going to take some time to fix it across all my plugins.

    If we move the shortcode into your template file, that will bypass the issue for now. Would you mind making me a user account on your site and I’ll handle it?

    You can email me directly ([email protected]).

    Thanks!

    Thread Starter Siinex

    (@siinex)

    So, we have a solution at last!

    In my case I wanted to implement the shortcode on a single page.

    The code snippet from the readme is:

    <?php echo do_shortcode('[getTwitchWallPro]'); ?>

    As I wanted it on a specific page this has to be added

    if(is_page(PAGEID)) { above code goes here ... }

    So, for example your code would look like this:

    <?php if (is_page('101')) { echo do_shortcode(['getTwitchWallPro']); } ?>

    And this Snippet has to be pasted into this file:
    ../themes/yourChildTheme/template-parts/content-page.php

    Much thanks to the plugin author for this solution!

    Ah, before I forget it: There are two Shortcodes
    1. getTwitchWallPro and
    2. getTwitchWall

    Depending on your plugin version, obviously

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Uncaught SyntaxError: Invalid or unexpected token’ is closed to new replies.