In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the relevant knowledge of "how to quickly modify the existing avatar in WordPress". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
How to modify WordPress's default Gravatar avatar, that is, if visitors have their own Gravatar avatar, they will display their own, if not, the site specified.
As shown in the following figure, the default profile picture of WordPress has been modified successfully!
The avatar in the picture above is not available by default, so we need to customize and modify it ourselves!
Friends who are familiar with WordPress should know that, in the background-setting-discussion, you can set the default Gravatar avatar, but the icons that come with you are really unflattering. Fortunately, WordPress provides the avatar_defaults hook, which allows us to add custom avatars. The following host selection discount network shares two modified methods.
Method 1: use code to customize the default Gravatar avatar of WordPress
Add the following code before the last? > of your theme's functions.php:
/ / modify the default avatar add_filter ('avatar_defaults',' default_avatar'); function default_avatar ($avatar_defaults) {$myavatar = 'https://i.loli.net/2020/07/19/idoODqFrH4XW7J5.jpg';// image and text url path $avatar_defaults [$myavatar] = "Host Select discount Network"; / / the description name of the image return $avatar_defaults;}
Modification Tip:
1. The fourth line of code is the URL address of the avatar. The above is the wpdaxue-gravatar.jpg under the images folder of the active theme. Please modify it according to the actual situation.
two。 The fifth line is the custom avatar name. The above is the default avatar of WordPress University. Please modify it yourself.
After you have saved it, you can see the new avatar under "backend"-"Settings"-"discussion", and set it to default:
Method 2: use the Add New Default Avatar plug-in
If you do not want to mess with the code, you can also directly install the Add New Default Avatar plug-in in the background, after enabling, you can add a custom avatar under the background-setting-discussion, which is very simple.
This is the end of the content of "how to quickly modify the existing avatar in WordPress". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.