免费《新手做网站视频教程》,在线观看,如果你想从零开始自己做网站,点击开始吧!

自动获取Bing每日超清图片、提供API接口

  1. 首页
  2. »
  3. 图文教程
  4. »
  5. WordPress建站教程
  6. »
  7. 自动获取Bing每日超清图片、提供API接口

文章目录

方法一:保存下面的图片,直接使用即可,与其他普通图片不同是该图片是调用API接口的,会每天自动更新。

右键下方图片另存为,保存即可,该图片是使用api接口的。

 

方法二:API接口

1920*1080分辨率图片地址:

https://api.dujin.org/bing/1920.php

1366*768分辨率图片地址:

https://api.dujin.org/bing/1366.php

使用方法:直接把它当做一个链接来用:

<img src="https://api.dujin.org/bing/1366.php" alt="Bing每日图片" />
<img src="https://api.dujin.org/bing/1920.php" alt="Bing每日图片超高清" />

 

设置为WordPress登录页背景:

将下面代码放入主题文件夹中的functions文件即可:

function custom_login_head(){
$imgurl = 'https://api.dujin.org/bing/1920.php';
if($imgurl){
echo'
'; }} add_action('login_head', 'custom_login_head'); add_filter('login_headerurl', create_function(false,"return get_bloginfo('url');")); add_filter('login_headertitle', create_function(false,"return get_bloginfo('name');"));

推荐阅读

联系我