Php 显示日期下面的确切时间
我有这个代码显示我的帖子日期Php 显示日期下面的确切时间,php,html,wordpress,Php,Html,Wordpress,我有这个代码显示我的帖子日期 <time datetime="<?php the_time('Y-m-j'); ?>" title="<?php the_time('F j, Y'); ?>"> <span class="post-date"><?php the_time('d'); ?></span> <span class="post-month uppercase"><?php the
<time datetime="<?php the_time('Y-m-j'); ?>" title="<?php the_time('F j, Y'); ?>">
<span class="post-date"><?php the_time('d'); ?></span>
<span class="post-month uppercase"><?php the_time('F'); ?></span>
</time>
我想补充一下我发帖的确切时间。
正如在Wordpress论坛上看到的那样,我尝试在下面添加一些代码,这些代码对一些人有用
<?php the_time('g:i a'); ?>
挨着
<?php the_time('F j, Y'); ?>
但时间仍然没有显现出来。
您能告诉我为什么它对我不起作用吗?时间没有显示,因为您将它添加到了时间元素的title属性,而不是元素内部 要显示时间,请将其添加到.post month span标记下 例如
. . .
<span class="post-month uppercase"><?php the_time('F'); ?></span>
<span class="post-time"><?php the_time( 'g:i a' ); ?></span>
. . .