简体   繁体   English

无法使Apple-touch-icon(书签的Webclip)在Wordpress网站上工作

[英]Can't get Apple-touch-icon (webclip for bookmarks) to work on Wordpress site

so I can't for the life of me get the apple-touch-icons working on my Wordpress site. 因此我一生都无法在Wordpress网站上使用苹果触摸图标。 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). 我使用的是WP 3.7.1,我也使用的是BPS安全性和WP超级缓存(以防万一它们可能与它有任何关系),另外,我使用的是Hostgator孵化​​共享服务器(基本服务器) 。

I'm trying to implement the code directly from Apple's developer support documents as shown below: 我正在尝试直接从Apple的开发人员支持文档中实现代码,如下所示:

<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. 我已将其添加到最顶部的wp-blog-header.php中,并将图标添加到了根文件夹中。 They have the same name as are in the href. 它们的名称与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. 我什至将文件上传到WP媒体并复制了相关的网址,没有运气。

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. 我记得几个月前,我能够毫无问题地为Joomla网站做到这一点。 I'd greatly appreciate your help and patience, thanks in advance guys! 非常感谢您的帮助和耐心,在此先感谢大家!

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. 如果这不起作用,请查看页面源,然后单击/复制并粘贴图像的URL,以查看生成的URL是否可用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM