解析错误:语法错误,第16行意外的T_CLASS single.php

时间:2014-02-10 14:49:32

标签: php syntax-error

如果有人能帮助我使用我的代码那么棒。我在第16行继续收到此错误。每当我在我的网站上打开帖子时,我都会收到错误消息。页面似乎工作正常。

<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?> <h3 class="subtitle"><?php echo get_post_meta($post->ID, 'sb_subtitle', 'true'); ?></h3>
            <h1 class="page-title"><?php the_title(); ?></h1>
            <p class="postmetadataw">Posted by: <?php the_author_posts_link() |  on <span class="post_date"><?php the_time('F j, Y'); ?></p> 

            <div class="content-ver-sep"> </div>
            <div class="entrytext"><?php the_post_thumbnail('category-thumb'); ?>
            <?php the_content(); ?>

我一直在尝试使用这些错误修复结构化数据:

hatom-feed
hatom-entry:    
Error: At least one field must be set for HatomEntry.
Error: Missing required field "entry-title".
Error: Missing required field "updated".
Error: Missing required hCard "author".
Error: At least one field must be set for HatomEntry.
Error: Missing required field "entry-title".
Error: Missing required field "updated".
Error: Missing required hCard "author".

1 个答案:

答案 0 :(得分:0)

您没有使用the_author_posts_link关闭PHP部分。试试:

<p class="postmetadataw">Posted by: <?php the_author_posts_link(); ?> |  on <span class="post_date"><?php the_time('F j, Y'); ?></p>