dtpk04526211 2013-12-11 20:39
浏览 114
已采纳

无法在Wordpress网站上使用Apple-touch-icon(书签的webclip)

so I can't for the life of me get the apple-touch-icons working on my Wordpress site. I'm on WP 3.7.1, and I'm also using BPS Security and WP Super Cache (just in case those might have anything to do with it), plus I'm on a Hostgator hatchling shared server (the basic one).

I'm trying to implement the code directly from Apple's developer support documents as shown below:

<link rel="apple-touch-icon" href="touch-icon-iphone.png">
<link rel="apple-touch-icon" sizes="76x76" href="touch-icon-ipad.png">
<link rel="apple-touch-icon" sizes="120x120" href="touch-icon-iphone-retina.png">
<link rel="apple-touch-icon" sizes="152x152" href="touch-icon-ipad-retina.png">

I've added that to wp-blog-header.php at the very top, and have added the icons to the root folder. They have the same name as are in the href. But this doesn't work at all. I searched online and found that some people had issues because their site was password protected.

I'm not sure exactly what this means, or in what context, but they said that they moved the files to another public/anonymous folder and that did the trick for them. Well it didn't for me. I even uploaded the files to WP media and copied the relative urls, and no luck.

Been scratching my head for a while and have no idea why I can't get it to work. I remember a few months ago I was able to do it for a Joomla site with no problem. I'd greatly appreciate your help and patience, thanks in advance guys!

  • 写回答

1条回答 默认 最新

  • duanfengtuo6012 2013-12-12 05:34
    关注

    Try uploading the images to your current template folder and use the following code:

    <link rel="apple-touch-icon" href="<?php bloginfo('template_url'); ?>/touch-icon-iphone.png">
    <link rel="apple-touch-icon" sizes="76x76" href="<?php bloginfo('template_url'); ?>/touch-icon-ipad.png">
    <link rel="apple-touch-icon" sizes="120x120" href="<?php bloginfo('template_url'); ?>/touch-icon-iphone-retina.png">
    <link rel="apple-touch-icon" sizes="152x152" href="<?php bloginfo('template_url'); ?>/touch-icon-ipad-retina.png">
    

    If this doesn't work, look at the page source and click/copy&paste the url of the image(s) to see if the generated URL is available.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 微信会员卡等级和折扣规则
  • ¥15 微信公众平台自制会员卡可以通过收款码收款码收款进行自动积分吗
  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分