【问题标题】:Parse error: syntax error, unexpected ':', expecting ',' or ';' [duplicate]解析错误:语法错误,意外的 ':',期待 ',' 或 ';' [复制]
【发布时间】:2015-12-08 14:20:55
【问题描述】:

我使用的是wordpress主题,出现以下解析错误:

解析错误:语法错误,意外 ':',期待 ',' 或 ';'在 /home/storage/9/ad/41/hunamarcenaria1/public_html/wp-content/themes/blink/page.php 第 1 行

<?php get_header(); ?>
<?php get_template_part( 'includes/page-title' ); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="centered-wrapper">
    <section class="percent-page> 
        <?php echo $deliciousmt:delicious_sidebar_position($post->ID); ?>
        <article id="page-<?php the_ID(); ?>" class="begin-content">
            <?php the_content(); ?>
        </article>
        <?php   
            // If comments are open or we have at least one comment, load up the comment template.
            if ( comments_open() || get_comments_number() ) :
                comments_template();
            endif;      
        ?>          
        <div class="double-space"></div>
    </section>      
    <?php endwhile; ?>
<?php endif; ?>             
<?php
    global $dt_sidebar_pos;
    if(($dt_sidebar_pos === 'sidebar-right') || ($dt_sidebar_pos === 'sidebar-left'))
        get_sidebar();      
 ?>
</div><!--end centered-wrapper-->
<?php get_footer(); ?>

我不是程序员,我正在尝试解决问题,但我不知道该怎么做。如果有人可以帮助我,那就太棒了!

【问题讨论】:

  • 回车真的有助于使代码可读。如果代码是为人类阅读而设计的,那么发现代码中的错误会很多

标签: php wordpress


【解决方案1】:

这是错误的

<?php echo $deliciousmt:delicious_sidebar_position($post->ID); ?>  
                       ^

使用. 运算符

<?php echo $deliciousmt." : ".delicious_sidebar_position($post->ID); ?>  

下一次更正

<section class="percent-page>

缺少关闭课程"

<section class="percent-page">
                            ^

【讨论】:

    猜你喜欢
    • 2012-07-04
    • 1970-01-01
    • 2013-06-28
    • 2021-11-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多