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 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?