我一直在WP主題(基於twentyeleven)對於有置頂文章聚光燈(功能)區,同時:http://www.designated.net.au/testbed/wordpress/WordPress的 - posted_on不顯示(PHP)
我遇到的問題是那個posted_on聲明不會顯示在貼子上。當談到PHP時,我總是喜歡Noob,所以我不知道自己在做什麼。
要擁有我用這個指南的置頂文章:http://line25.com/tutorials/how-to-create-a-featured-post-layout-in-wordpress
但我改變後的顯示使用代碼content.php。所以我使用以下內容:
<?php if ('post' == get_post_type()) : ?>
<div class="entry-meta">
<?php twentyeleven_posted_on(); ?>
</div><!-- .entry-meta -->
<?php endif; ?>
這是不顯示的部分。
如果你需要我,我很樂意提供更多的代碼。
你的全局變量'$ post'如何? 'if語句的'var_dump($ post)'。然後,檢查'$ the_post-> post_type'的值 – mikespook
我該如何實現並檢查值? – dais
這是我得到的:'object(stdClass)#215(24){[「ID」] => int(15)[「post_author」] => string(1)「1」[「post_date」] =>字符串(19)「2012-09-11 04:23:42」[「post_date_gmt」] =>字符串(19)「2012-09-11 04:23:42」[「post_content」] =>字符串(187) 「'。 – dais