我需要在我的wordpress模板中自定義single.php模板。 在我的single.php我這行wordpress模板佈局single.php
我的新模板,需要顯示圖像後,發佈日期,後文。
我該怎麼做?
感謝
我需要在我的wordpress模板中自定義single.php模板。 在我的single.php我這行wordpress模板佈局single.php
我的新模板,需要顯示圖像後,發佈日期,後文。
我該怎麼做?
感謝
谷歌可以很容易地告訴你,這是如何做到的,但因爲我在這裏,我會幫忙。
首先,瞭解WordPress Loop。
打開你的single.php模板,並粘貼以下:
<?php
if (have_posts()) {
while (have_posts()) {
the_post();
// Post Image
the_post_thumbnail();
// Post Date
the_date();
// The Post Content
the_content();
} // end while
} // end if
?>
使用的功能,然後讀了起來:
謝謝!對不起,但我與wordpress新手,我開始讀同樣的想法。 –
我嘗試,但the_content()也顯示張貼圖像。 –
嘗試使用此處的答案刪除圖像:http://wordpress.stackexchange.com/a/162165/70417 –
你有學習php o r使用一個插件,爲你做。谷歌周圍。 http://www.wpbeginner.com/wp-themes/create-custom-single-post-templates-for-specific-posts-or-sections-in-wordpress/ – Christina