2011-07-15 21 views
2

私は無料のWPテーマを構築していますが、PHPについては何も教えていません。私は何を置くべきかを私にラテン語を話すのと同じように伝えているので、誰かが正しいPHPタグを置くことができるかどうか、このコードをどのように置くべきか分かりません。私は最後に冒頭に<?php?>を入れてみましたが、それはうまくいきませんでした:WP WordPressのテーマの問題

if (has_post_format('aside') { 
    // aside format post content here 
} else if (has_post_format('gallery')) { 
    // stuff to display the gallery format post here 
} else if (has_post_format('link')) { 
    // link format post content here 
} else if (has_post_format('video')) { 
    // video format post content here 
} else if (has_post_format('audio')) { 
    // audio format post content here 
} else if (has_post_format('status')) { 
    // status format post content here 
} else if (has_post_format('chat')) { 
    // chat format post content here 
} else if (has_post_format('quote')) { 
    // quote format post content here 
} else if (has_post_format('image')) { 
    // image format post content here 
}else { 
    // code to display the normal format post here 
} 
+0

何を意味すべきですか? – dqhendricks

+2

"素晴らしい無料のWPテーマ... PHPについては何も知らない"古典的な+1 – sdolgy

+0

@dqhendricksこれはエラーを返します:構文エラー:予期しない構文エラー '{' @sdolgy - 私たちの一部はグラフィックデザインの終了をしますテーマはコミュニティの大部分のために作られていますが、今ではいくつかの仕上げを追加しています。 – Lucas

答えて

3

は、任意のコードを保持していないすべての行の前に<?phpを入れて(したがって}場合またはで始まる)、 とこれらの行は?>で終了してください。

0

また、この最初の行は間違っています。

if (has_post_format('aside') { 

あなたは "それが機能しなかった" ことで、正確に

if (has_post_format('aside')) { 
関連する問題