2012-12-20 38 views
0

我试图改变日期,当你点击日历,并得到一个帖子来。近期文章更改标题日期

目前标题为Y,m,d(2012年12月20日)我想将其更改为l,F j,Y(2012年12月20日星期四)。

我操纵哪个PHP的Wordpress文件来做这个改变?

干杯

约翰

回答

0

请做一件事刚刚替换功能twentyeleven_posted_on()下面功能的functions.php 希望它会给你你需要的日期格式。

function twentyeleven_posted_on() { 
    printf(__('<span class="sep">Posted on </span><a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a><span class="by-author"> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="%5$s" title="%6$s" rel="author">%7$s</a></span></span>', 'twentyeleven'), 
     esc_url(get_permalink()), 
     esc_attr(get_the_time()), 
     esc_attr(get_the_date('l, F j, Y')), 
     esc_html(get_the_date()), 
     esc_url(get_author_posts_url(get_the_author_meta('ID'))), 
     esc_attr(sprintf(__('View all posts by %s', 'twentyeleven'), get_the_author())), 
     get_the_author() 
    ); 
} 
+0

您好Praveen卡拉尔谢谢您的留言。在进行修改之前,我需要提出一个问题。这不应该在我使用的主题中完成,而不是在tweentyeleven主题中完成? – TLCJohn

+0

好吧,做一件事情只需在function.php中将get_the_date()和get_comment_date()替换为get_the_date('l,F j,Y')和get_comment_date('l,F j,Y'),其中上述函数正在调用。 –