2014-09-13 106 views
-4

嗨我在我的網站上有這樣的錯誤 我的網站是WordPress的4 我使用後的格式 在崗格式我創建這個PHP來,如果頁面有報價後,然後不從報價負載的標題和圖像,並等後只顯示報價的內容是元框(WordPress的)使用未定義的常量

Notice: Use of undefined constant quote - assumed 'quote' in C:\xampp\htdocs\personal\wp-content\themes\personal\warp\systems\wordpress\layouts\_post.php on line 4 

Notice: Use of undefined constant quote - assumed 'quote' in C:\xampp\htdocs\personal\wp-content\themes\personal\warp\systems\wordpress\layouts\_post.php on line 14 


這是波紋管

0 _post.php代碼
<?php $format = get_post_format(); ?> 
<article id="post-<?php the_ID(); ?>" <?php post_class('group'); ?>>  
<?php 
if ($format != quote) { 
$css_class = "b-box"; 
} else { 
$css_class = "q-box"; 
} 

echo "<div class=\"$css_class\">"; 
?> 
     <?php get_template_part('inc/post-formats'); ?> 

     <?php if ($format != quote) : ?> 
     <div class="post-content"> 
      <div class="blog-img-box"> 
       <img src="<?php echo catch_that_image() ?>" alt="<?php the_title(); ?>" /> 
      </div> 
    <div class="post-deco blog-icon-box"> 
      <div class="hex hex-small"> 
       <i class="fa blog-icon"></i> 
       <?php if ($format != false) :?><a href="<?php echo get_post_format_link($format); ?>"></a><?php endif; ?> 
      </div> 
     </div><!--/.post-deco--> 
     <h2 class="blog-title"> 
     <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a> 
    </h2><!--/.post-title--> 
      <div class="blog-details row"> 
         <div class="col-md-4"><i class="fa fa-calendar blog-details-icons"></i> 
          <p class="blog-details-icons-txt"><?php the_time('j M, Y'); ?></p> 
         </div> 
         <div class="col-md-4"> 
         <a href="<?php comments_link(); ?>"> 
         <i class="fa fa-comment blog-details-icons"></i> 
          <p class="blog-details-icons-txt"><?php comments_number('0', '1', '%'); ?>&nbsp;Comments</p></a> 
         </div> 
         <div class="col-md-4"><i class="fa fa-eye blog-details-icons"></i> 
          <p class="blog-details-icons-txt"><?php echo getPostViews(get_the_ID()); ?></p> 
         </div> 
         <div class="likes"><i class="fa fa-heart blog-details-icons"></i> 
          <p class="blog-details-icons-txt">18</p> 
         </div> 
        </div> 
        <div class="blog-txt"> 
      <?php the_excerpt(); ?> 
      </div> 
      <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><div class="readmore-box"><p class="readmore-txt"><?php _e('Read More','anew'); ?></p></div></a> 
     </div><!--/.post-content--> 
     <?php endif ?> 
    </div><!--/.post-inner--> 
</article><!--/.post--> 

請和我說什麼,我錯了

謝謝!

+0

你能編輯你的文章並在這裏和那裏添加一些'.'和','字符嗎?建議使用大寫字母。目前,我很難精神分析你的第一句話(?)。 – usr2564301 2014-09-13 13:34:27

回答

0

如果你想使用quote爲文字字符串(4號線),而不是一個變量名,則必須將它變成單或雙引號字符('")。否則,PHP認爲你正在引用一個PHP常量。

由於向後兼容的原因,PHP使用字符串作爲文字,但它確實會拋出一個E_NOTICE錯誤 - 您遇到的錯誤。

相關問題