<?phpif (! isset($wp_did_header)):if ( !file_exists( dirname(__FILE__) . '/wp-config.php') ) {if (strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false) $path = ''; else $path = 'wp-admin/';

require_once( dirname(__FILE__) . '/wp-includes/classes.php');require_once( dirname(__FILE__) . '/wp-includes/functions.php');require_once( dirname(__FILE__) . '/wp-includes/plugin.php');wp_die("There doesn't seem to be a <code>wp-config.php</code> file. I need this before we can get started.Need more help? <a href='http://codex.wordpress.org/Editing_wp-config.php'>We got it</a>. You can <a href='{$path}setup-config.php'>create a <code>wp-config.php</code> file through a web interface</a>, but this doesn't work for all server setups. The safest way is to manually create the file.", "WordPress &rsaquo; Error");}$wp_did_header = true;require_once( dirname(__FILE__) . '/wp-config.php');wp();gzip_compression();require_once(ABSPATH . WPINC . '/template-loader.php');endif;?>

解决方案 »

  1.   

    if (! isset($wp_did_header)):if ( !file_exists( dirname(__FILE__) . '/wp-config.php') )中的 : 是怎么个理解发...
      

  2.   

    应该是没有这种运算符的...最起码应该也是 a?b:c这种格式.....
    现在该怎么理解好呢...
      

  3.   

    if (! isset($wp_did_header)):
    =
    !isset($wp_did_header)?1:if ( !file_exists( dirname(__FILE__) . '/wp-config.php') )难道这样解释?
      

  4.   

    if (! isset($wp_did_header)):
    .....
    endif;与
    if (! isset($wp_did_header)) {
    .....
    }一样,只是书写格式不同而已!
      

  5.   

    兄弟,你没看手册吧?if() :
    ....
    endif;
    是if() {...}的另外一种写法
      

  6.   

    if ($foo);
        echo "yep\n";
    elseif ($bar);
        echo "almost\n";
    else;
        echo "nope\n";
    endif; 
     
    例 F-6. 移植:新的 if..endif 语法if ($foo):
        echo "yep\n";
    elseif ($bar):
        echo "almost\n";
    else:
        echo "nope\n";
    endif; 
     这个吗?
      

  7.   

    if..endif 语法
    使用 if(); elseif(); else; endif; 这一系列复杂的语句无助于 PHP 3.0 解析器的效率。因此,语法改变为: 例 F-5. 移植:旧有 if..endif 语法if ($foo);
        echo "yep\n";
    elseif ($bar);
        echo "almost\n";
    else;
        echo "nope\n";
    endif; 
     
    例 F-6. 移植:新的 if..endif 语法if ($foo):
        echo "yep\n";
    elseif ($bar):
        echo "almost\n";
    else:
        echo "nope\n";
    endif; 
     
    注意,在所有的声明中分号均改为冒号,除了末尾的 endif 以外。 
      

  8.   

    endif;, endwhile;, endfor;, endforeach;, or endswitch;
      

  9.   

    流程控制的替代语法
    PHP 提供了一些流程控制的替代语法,包括 if,while,for,foreach 和 switch。替代语法的基本形式是把左花括号({)换成冒号(:),把右花括号(})分别换成 endif;,endwhile;,endfor;,endforeach; 以及 endswitch;。 
    <?php if ($a == 5): ?>
    A is equal to 5
    <?php endif; ?> 在上面的例子中,HTML 内容“A is equal to 5”用替代语法嵌套在 if 语句中。该 HTML 的内容仅在 $a 等于 5 时显示。 替代语法同样可以用在 else 和 elseif 中。下面是一个包括 elseif 和 else 的 if 结构用替代语法格式写的例子: 
    <?php
    if ($a == 5):
        echo "a equals 5";
        echo "...";
    elseif ($a == 6):
        echo "a equals 6";
        echo "!!!";
    else:
        echo "a is neither 5 nor 6";
    endif;
    ?> 更多例子参见 while,for 和 if。 
      

  10.   

    你的WORDPRESS的格式语法较老。新版本的PHP已经抛弃这种语法了。
      

  11.   

    你说的是WordPress 2.2.2 下载(英文版/中文版)吗?我贴的只是WordPress 2.2.1先道歉了....
      

  12.   

    你的WORDPRESS的格式语法较老。新版本的PHP已经抛弃这种语法了。.......
    这是什么意思?
    wp 2.2
     也是用这个语法啊