2017-01-30 4 views
1

google SERPで私のタイムスタンプは私の記事の作成日ですが、定期的に更新するので、代わりに更新日を表示したいと思います。私は、Googleが見つけた最初の日付を使用していることを読んでいます。それは作成日です(更新日はそれ以降に書かれています)。私のWordpressウェブサイトのタイムスタンプを変更する

私が代わりにこの程度のコード

に変更したい

:私は次のように作成したい2016年7月5日

:上に作成

:2010年7月2日、更新日:

は更新日:2010年7月2日

は、基本的にはちょうど切り替え:2016年7月5日、上で作成されましたGoogleが正しい日付を選ぶように2つの日付。

私のpage.php上の次は

   <div class="blog_info contentsbox <?php st_hidden_class(); ?>"> 
       <p>Created on: 
        <time class="entry-date" datetime="<?php the_time(DATE_W3C); ?>"> 
         <?php the_time('Y/m/d'); ?> 
        </time> 
        <br> 
        <?php if ($mtime = st_get_mtime('Y/m/d')) { 
         echo 'Updated on:', $mtime; 
        } ?> 
       </p> 
      </div> 

そして、私焦がすPHPで書かれました:

    <div class="blogbox <?php st_hidden_class(); ?>"> 
        <p><span class="kdate"><i class="fa fa-calendar"></i>&nbsp; 
      <time class="entry-date date updated" datetime="<?php the_time(DATE_W3C); ?>"> 
       <?php the_time('Y/m/d'); ?> 
      </time> 
      &nbsp; 
          <?php if ($mtime = st_get_mtime('Y/m/d')) { 
           echo ' <i class="fa fa-repeat"></i>&nbsp; ', $mtime; 
          } ?> 
      </span></p> 
       </div> 

は助け

+0

私の回答はあなたを助けましたか? – mdarmanin

答えて

0
<div class="blog_info contentsbox <?php st_hidden_class(); ?>"> 
    <p> 
     <?php if ($mtime = st_get_mtime('Y/m/d')) { 
      echo 'Updated on:', $mtime; 
     } ?> 
     <br> 
     Created on: 
     <time class="entry-date" datetime="<?php the_time(DATE_W3C); ?>"> 
      <?php the_time('Y/m/d'); ?> 
     </time>       
    </p> 
</div> 

およびその他のために事前にありがとう1:

<div class="blogbox <?php st_hidden_class(); ?>"> 
    <p> 
     <span class="kdate"><i class="fa fa-calendar"></i>&nbsp; 
      <?php if ($mtime = st_get_mtime('Y/m/d')) { 
       echo ' <i class="fa fa-repeat"></i>&nbsp; ', $mtime; 
      } ?> 
      &nbsp; 
      <time class="entry-date date updated" datetime="<?php the_time(DATE_W3C); ?>"> 
       <?php the_time('Y/m/d'); ?> 
      </time> 
     </span> 
    </p> 
</div> 
関連する問題