0

我收到此错误:

Uncaught SyntaxError: Unexpected token <

这反过来又导致了这个错误:

Uncaught ReferenceError: nfForms is not defined
at n.initialize (front-end.js:1)
at n.s.Object (front-end-deps.js:20)
at new n (backbone.min.js:1)
at n.initialize (front-end.js:2)
at n.s.Object (front-end-deps.js:20)
at new n (backbone.min.js:1)
at n.initialize (front-end.js:3)
at n.s.Object (front-end-deps.js:20)
at n.constructor (front-end-deps.js:21)
at new n (backbone.min.js:1)

但我找不到导致问题的“<”。我为 wordpress 上的 Inbound Pro 插件创建了自己的登录页面模板。我检查了我的代码、源代码和表明问题存在的文件,但我找不到导致问题的“<”。我是疯了还是他们在这里扮演了一个更大的问题?

https://idsource.com/go/general-quote-page/

**编辑 - 更多信息:我忘了提到由于此错误而导致的主要问题是蓝色部分中的表单无法加载。我正在为我的表单使用 Ninja Forms 插件,并且上述错误之一指出“未定义 nfForms”。

**编辑 - 页面的 html:

<?php

/* Landing Page Boiler Plate */
$key = lp_get_parent_directory(dirname(__FILE__));
$path = LANDINGPAGES_UPLOADS_URLPATH ."$key/";
$url = plugins_url();

/* Define Landing Pages's custom pre-load hook for 3rd party plugin integration */
do_action('lp_init');

/* Load $post data and start normal WordPress Loop */
if (have_posts()) : while (have_posts()) : the_post();
$id = get_the_ID();
$title = get_the_title($id);
$content = lp_get_value($post, $key, 'main-content');
$conversion_area = lp_get_value($post, $key, 'conversion-area-content');

$sharetext = lp_get_value($post, $key,  'sharetext' );
$share_link = lp_get_value($post, $key,  'shareurl' );
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <title><?php wp_title(); ?></title>
    <meta name="viewport" content="initial-scale=1,user-scalable=no,maximum-scale=1,width=device-width">

    <?php wp_head(); // Load Regular WP Head
          do_action('lp_head'); // Load Custom Landing Page Specific Header Items
    ?>

    <link rel="stylesheet" href="<?php echo $path;?>lp.css" type="text/css">

    <?php if ($share_link != ""){
        $share_link = $share_link;
    } else {
        $share_link = get_permalink( $id );
    } ?>

</head>
<body>

    <header>
        <div class="page_center large">
            <?php $logo = get_field('logo'); 
                        if( !empty($logo) ): 
                    ?>
                        <img src="<?php echo $logo['url']; ?>" alt="<?php echo $logo['alt']; ?>">

                    <?php endif; ?>
        </div>
    </header>

    <section class="lp_banner">
        <div class="page_center large">
            <?php the_field('banner_content'); ?>
        </div>

        <div class="page_center large thirds">
        <?php
            // check if the repeater field has rows of data
            if( have_rows('banner_repeater') ):

                // loop through the rows of data
                while ( have_rows('banner_repeater') ) : the_row();
        ?>
            <div class="third">
                <?php $image = get_sub_field('repeater_image'); 
                    if( !empty($image) ): 
                ?>
                <img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>">
                <?php endif; ?>
                <span><?php the_sub_field('repeater_text'); ?></span>
            </div>

            <?php

            endwhile;

            else :

                // no rows found

            endif;

            ?>

        </div>
    </section>

    <section class="lp_form">
        <div class="page_center">
                <?php the_field('quote_section_content'); ?>
            <div class="form_wrap">
                <?php the_field('quote_section_form'); ?>
            </div>
        </div>
    </section>

    <section class="designer">
        <div class="page_center large">
            <div class="left">
                <?php the_field('designer_section_text'); ?>
            </div>
            <div class="right">
                <div class="page_center">
                    <?php $desImage = get_field('designer_section_image'); 
                        if( !empty($desImage) ): 
                    ?>
                        <img src="<?php echo $desImage['url']; ?>" alt="<?php echo $desImage['alt']; ?>">

                    <?php endif; ?>
                </div>
            </div>
        </div>
    </section>

        <?php break;
            endwhile; endif; // End wordpress loop
        ?>
    <footer>
        <?php

        do_action('wp_footer');
        do_action('lp_footer');
        ?>
    </footer>
</body>
</html>
4

0 回答 0