当前位置: 首页 > 阿里云优惠 > 阿里云服务器优惠>> WordPress主题怎么使用Gravatar头像 – WordPress 教程

WordPress主题怎么使用Gravatar头像 – WordPress 教程

其实在WordPress2.5以上版本,已经集成了Gravatar头像功能,但很多同学使用的主题并不支持这一功能,所以并没有对Gravatar头像做一定了解,其实让主题支持Gravatar头像并不难。

首先在主题文件夹中找到comments.php,在其中查找

<?php comment_text() ?>

并在之前加入

<?php echo get_avatar( $comment, 50 ); ?>

即可

50是头像的大小,可以更改.

比如:我用的这个主题

<div class="obsahk"><?php echo get_avatar( $comment, 50 ); ?><?php comment_text() ?><?php edit_comment_link('编辑','<p>','</p>'); ?></div>

服务器购买/咨询热线:1563700917115617636856

本文链接:http://www.sqxnmj.com/alfwq/28673.html
tags:
腾讯云服务器特惠

  • 关注微信
是否收录:

猜你喜欢

微信公众号