在WordPress中创建新页面时出现page.php错误

时间:2017-11-01 16:35:22

标签: php wordpress

<?php get_header(); ?>
        </div><!--END CONTAINER-->
        <?php 
            if (get_field('header_image')){
                $image = get_field('header_image');
                if (get_field('do_not_use_page_title')){
                    $title = get_field('alternate_page_title');
                }else {
                    $title = get_the_title();
                }
                if (get_field('subheading')) $subheading = get_field('subheading');
                ?>
                <div class="page-header" style="background-image: url(<?php echo $image['url']?>);">
                    <?php echo "<h1>$title</h1>"; ?>
                    <?php if ($subheading) { echo "<h2>$subheading</h2>";} ?>
                </div>
                <?
            }
        ?>
        <div class="container">
        <div id="content" class="clearfix row">

            <div id="main" class="col-sm-8 clearfix" role="main">

                <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

                <article id="post-<?php the_ID(); ?>" <?php post_class('clearfix'); ?> role="article" itemscope itemtype="http://schema.org/BlogPosting">

                    <?php if (!(get_field('header_image'))) { ?>
                    <header>

                        <div class="page-header"><h1 class="page-title" itemprop="headline"><?php the_title(); ?></h1></div>

                    </header> <!-- end article header -->
                    <?php } ?>

                    <section class="post_content clearfix" itemprop="articleBody">
                        <?php the_content(); ?>

                    </section> <!-- end article section -->



                </article> <!-- end article -->


                <?php endwhile; ?>      

                <?php else : ?>

                <article id="post-not-found">
                    <header>
                        <h1><?php _e("Not Found", "wpbootstrap"); ?></h1>
                    </header>
                    <section class="post_content">
                        <p><?php _e("Sorry, but the requested resource was not found on this site.", "wpbootstrap"); ?></p>
                    </section>
                    <footer>
                    </footer>
                </article>

                <?php endif; ?>

            </div> <!-- end #main -->


        </div> <!-- end #content -->

在WP中创建新页面时出现错误

Parse error: syntax error, unexpected end of file in /home/example.com/example/public_html/wp-content/themes/exampletheme/page.php on line 69

我无法在php中发现任何会触发此解析错误的错误。网站上已经存在的其他页面工作正常,但是制作新页面然后查看/预览它们会带来上面错误的空白页面。任何帮助将不胜感激,谢谢。

0 个答案:

没有答案