2017-03-31 80 views
0

我需要在我的wordpress模板中自定義single.php模板。 在我的single.php我這行wordpress模板佈局single.php

我的新模板,需要顯示圖像後,發佈日期,後文。

我該怎麼做?

感謝

+1

你有學習php o r使用一個插件,爲你做。谷歌周圍。 http://www.wpbeginner.com/wp-themes/create-custom-single-post-templates-for-specific-posts-or-sections-in-wordpress/ – Christina

回答

0

谷歌可以很容易地告訴你,這是如何做到的,但因爲我在這裏,我會幫忙。

首先,瞭解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 
?> 

使用的功能,然後讀了起來:

the_post_thumbnail()

the_date()

the_content()

+0

謝謝!對不起,但我與wordpress新手,我開始讀同樣的想法。 –

+0

我嘗試,但the_content()也顯示張貼圖像。 –

+0

嘗試使用此處的答案刪除圖像:http://wordpress.stackexchange.com/a/162165/70417 –