首页 » Wordpress » WordPress技巧:每文章下添加版权说明

WordPress技巧:每文章下添加版权说明

6726 1

wordpress每篇文章存在的页面是single.php,只要稍微有点会点php语言的话,就可以自己修改single.php,在文章和评论之间插入一段版权说明。可以直接修改本地single.php文件然后通过FTP上传到服务器上覆盖原文件,也可以直接从wordpress后台控制板–外观–编辑,右侧列表里找到single.php进行在线编辑。

找到类似以下语句,由于主题不同,以下代码会有出入:

<div class="entry">
    <?php the_content('Read more...'); ?>
    <div class="clear"></div>
    <div class="tags">
      <?php the_tags(); ?>
      <?php edit_post_link('Edit', '[ ', ' ]'); ?>
    </div>
  </div>
  <?php comments_template(); ?>
  <?php endwhile; else: ?>
  <?php endif; ?>
</div>

本站是将版权说明插入在评论的上方,因此修改为如下即可:

<div class="entry">
    <?php the_content('Read more...'); ?>
    <div class="clear"></div>
    <div class="tags">
      <?php the_tags(); ?>
      <?php edit_post_link('Edit', '[ ', ' ]'); ?>
    </div>
  </div>
  <!--end: entry-->
  
  <p class="declare">
    本文原始地址:<a href=<?php the_permalink(); ?>><?php the_permalink(); ?></a><br>
    本站所有文章,除了特别注明外,均为本站原创,转载请注明出处来自<a href="http://www.tiandiyoyo.com">www.tiandiyoyo.com</a>
  </p>
  <?php comments_template(); ?>
  <?php endwhile; else: ?>
  <?php endif; ?>
</div>

接着自行修改css样式,达到自己满意的效果即可。

文章评分3次,平均分5.0

本文原始地址:https://www.tiandiyoyo.com/2011/10/wordpress-add-author-declair/
本站所有文章,除了特别注明外,均为本站原创,转载请注明出处来自www.tiandiyoyo.com

您可能还会对以下文章感兴趣:

评论前先开启评论开关:


1 Comment

载入分页评论...