2010-04-04 50 views

回答

1

基本上the_loop是

 
foreach (get_posts('showpost=-1') as $mypost) { 
    //and the output of the_content is similar with 
    echo $mypost->post_content; 
} 

PS類似:當你不正確的LOOP使用the_content並用上述方法改變它,那麼你將失去一些WordPress的功能,如簡碼API,內容衛生等。這些功能將幫助您清理您的內容並添加更多功能。

+0

謝謝。我不知道那種PHP語法「as mypost」,會搜索它。 – user310291 2010-04-05 07:50:58

+0

它是PHP。這是調用foraech ...我會嘗試找到你的鏈接或嘗試在php.net中搜索 – justjoe 2010-04-05 07:52:43

1

get_posts()的名稱如下:收集一堆帖子。 the_content()返回單個帖子的內容。它們不可互換。

+0

嗯,我的意思是一個循環 – user310291 2010-04-04 18:00:32

+0

當然,'the_content內the_content()'不能在循環外使用。 – fuxia 2010-04-04 18:14:22