2014-01-14 47 views
-2

ALEXA條形碼已損壞,您能幫我修復嗎? IT將是一個很大的幫助。我認爲Tag沒有關閉。這就是爲什麼我的網頁頁腳不見了。如何解決此問題Sidebar.php

完整的代碼是在這裏:http://ideone.com/hqUTJ3

前瞻:

<?php 
if(tie_get_option('columns_num') != '2c'): 
?> 
<aside class="sidebar-narrow"> 
<?php 
    if (is_home()){ 

     $sidebar_home = tie_get_option('sidebar_narrow_home'); 
     if($sidebar_home) 
      dynamic_sidebar (sanitize_title($sidebar_home)); 

     else dynamic_sidebar('narrow-primary-widget-area'); 
+3

您沒有關閉第一個if? – Sekai

+3

或第二個如果 – Rottingham

+0

這是完整的代碼http://ideone.com/hqUTJ3 上面給出的只是預覽。 –

回答

2
<?php 
    if (tie_get_option('columns_num') != '2c') : 
?> 
    <aside class="sidebar-narrow"> 
<? endif ?> // <-- You need to close your if() : above 

<?php 
    if (is_home()) { 

     $sidebar_home = tie_get_option('sidebar_narrow_home'); 
     if ($sidebar_home) { 
      dynamic_sidebar(sanitize_title($sidebar_home)); 
     } 
     else { 
      dynamic_sidebar('narrow-primary-widget-area'); 
     } 
    } // <--- You need to close your if 

我建議不使用的代碼braceless塊。 IE

if (true) 
    dothis(); 

爲了幫助段代碼,以便這個問題不會再發生,使用大括號周圍的每一個條件代碼塊。它使事物組織化,可讀性強,可格式化並可調試到人眼。

if (true) { 
    dothis(); 
} 
+0

http://ideone.com/hqUTJ3 上面給出的僅僅是PREVIEW。 –

+0

在沒有所有信息的情況下詢問問題時總是很好。 *嘆* – Rottingham

+0

即插即用這個原因,這將已經解決了什麼OP張貼。 –