{"id":4400,"date":"2011-02-23T03:38:03","date_gmt":"2011-02-23T11:38:03","guid":{"rendered":"http:\/\/www.oeconomist.com\/blogs\/daniel\/?page_id=4400"},"modified":"2020-05-19T06:01:32","modified_gmt":"2020-05-19T13:01:32","slug":"favicons-apple-touch-icons-and-site-thumbnail-images","status":"publish","type":"page","link":"https:\/\/www.oeconomist.com\/blogs\/daniel\/?page_id=4400","title":{"rendered":"FavIcons, Apple Touch Icons, and Site Thumbnail Images"},"content":{"rendered":"<p>This page is the first part of <a href=\"?p=4489\">a discussion on supporting <code>favicon<\/code>s, Apple Touch icons, and site thumbnail images<\/a>.  First, I'll try to explain the r&ocirc;les and invocations of these images without peculiar reference to <a href=\"https:\/\/www.wordpress.org\/\">WordPress<\/a>  or to <a href=\"https:\/\/www.php.net\/\"><abbr title=\"Personal Home Pages Hypertext Processor\">PHP<\/abbr><\/a>.<\/p> <p>If you're already quite familiar with these three sorts of graphics and with the <abbr title=\"HyperText Mark-up Language\">HTML<\/abbr> to associate them with a webpage, and just want some <a href=\"https:\/\/www.php.net\/\"><abbr title=\"Personal Home Pages Hypertext Processor\">PHP<\/abbr><\/a> which you can insert into a <a href=\"https:\/\/www.wordpress.org\">WordPress<\/a> theme to generate such <abbr title=\"HyperText Mark-up Language\">HTML<\/abbr>, then you might want to go onto <a href=\"?page_id=4424\"><q>FavIcons, Apple Touch Icons, Site Thumbnail Images, and WordPress: The Code and How to Use It<\/q><\/a>.<\/p> <h4>FavIcons<\/h4> <p><code>favicon<\/code>s are those images, typically tiny, associated with specific websites, in or beside <abbr title=\"Uniform Resource Locator\">URL<\/abbr> fields <img loading=\"lazy\" decoding=\"async\" src=\"wp-content\/uploads\/2011\/02\/urlfield.jpg\" alt=\"\" width=\"248\" height=\"26\" style=\"border: 0 ; display: block ; margin-top: 1em ; margin-bottom: 1em ; margin-left: auto ; margin-right: auto ;\" \/> on browser tabs <img loading=\"lazy\" decoding=\"async\" src=\"wp-content\/uploads\/2011\/02\/browsertab.jpg\" alt=\"\" width=\"263\" height=\"275\" style=\"border: 0 ; display: block ; margin-top: 1em ; margin-bottom: 1em ; margin-left: auto ; margin-right: auto ;\" \/> and especially in menus of bookmarks <img loading=\"lazy\" decoding=\"async\" src=\"wp-content\/uploads\/2011\/02\/linkmenu.png\" alt=\"\" width=\"450\" height=\"300\" style=\"border: 0 ; display: block ; margin-top: 1em ; margin-bottom: 1em ; margin-left: auto ; margin-right: auto ;\" \/><\/p> <p>(The <code>fav<\/code>&#91;orite&#93;<code>icon<\/code> is named from Microsoft's practice of calling a browser bookmark a <q>favorite<\/q>, begun as part of an effort to dominate use of the 'Net, in part by controlling the vernacular; and the <code>favicon<\/code> was introduced as something first supported by <abbr title=\"Microsoft\">MS<\/abbr><abbr title=\"Internet Explorer\">IE<\/abbr>.)<\/p> <p>Some browsers look for a <code>favicon<\/code> as a file named <q><code>favicon.ico<\/code><\/q> (and encoded in the Windows <code>.ICO<\/code> format) in the basis directory or in the the highest directory of a domain.  Some look for it as specified for a page by a tag of form<\/p> <blockquote style=\"width: 91%; overflow: auto ; white-space: nowrap ;\"><code>&lt;link rel=&#34;<u>icon<\/u>&#34; href=&#34;<\/code><var>image<abbr title=\"Uniform Resource Locator\">URL<\/abbr><\/var><code>&#34; type=&#34;image\/<\/code><var>mimeImageSubtype<\/var><code>&#34; \/&gt;<\/code><\/blockquote> <p>such as<\/p> <blockquote style=\"width: 91%; overflow: auto ; white-space: nowrap ;\"><code>&lt;link rel=&#34;icon&#34; href=&#34;&#104;ttp:\/\/www.oeconomist.com\/favicon.png&#34; type=&#34;image\/png&#34; \/&gt;<\/code><\/blockquote> <p>while others look for it as specified for a page by a tag of form<\/p> <blockquote style=\"width: 91%; overflow: auto ; white-space: nowrap ;\"><code>&lt;link rel=&#34;<u>shortcut icon<\/u>&#34; href=&#34;<\/code><var>image<abbr title=\"Uniform Resource Locator\">URL<\/abbr><\/var><code>&#34; type=&#34;image\/<\/code><var>mimeImageSubtype<\/var><code>&#34; \/&gt;<\/code><\/blockquote> <p>such as<\/p> <blockquote style=\"width: 91%; overflow: auto ; white-space: nowrap ;\"><code>&lt;link rel=&#34;shortcut icon&#34; href=&#34;&#104;ttp:\/\/www.oeconomist.com\/favicon.png&#34; type=&#34;image\/png&#34; \/&gt;<\/code><\/blockquote> <p>A reasonable response is to include <em>both<\/em> tags in each webpage and, where possible, put a <code>favicon.ico<\/code> in the highest directory of the domain.  Putting a <code>favicon.ico<\/code> in every remaining directory (even as a symbolic link to the image in the main directory) may not be worth the effort.<\/p> <p>Typically, a <code>favicon<\/code> should be 16&times;16.  The <code>.ICO<\/code> format allows a website to deliver a <em>set<\/em> of images in different resolutions, from which a browser might choose one most suitable to whatever it is doing, but such files are larger, and browsers won't necessarily make good use of alternate sizes.<\/p> <h4>Apple Touch Icons<\/h4> <p>Apple Touch icons are graphics for the iPod, iPhone, iPad, and similar products to use in cre&auml;ting virtual buttons linked to websites. <img loading=\"lazy\" decoding=\"async\" src=\"wp-content\/uploads\/2011\/02\/ipod.png\" alt=\"\" width=\"343\" height=\"288\" style=\"border: 0 ; display: block ; margin-top: 1em ; margin-bottom: 1em ; margin-left: auto ; margin-right: auto ;\" \/><\/p> <p><em>In the absence of a specifying tag<\/em>, the highest directory of the domain is searched for a <code>.PNG<\/code> with one of these names: <ol><li><code>apple-touch-icon-57x57-precomposed.png<\/code><\/li><li><code>apple-touch-icon-57x57.png<\/code><\/li><li><code>apple-touch-icon-precomposed.png<\/code><\/li><li><code>apple-touch-icon.png<\/code><\/li><\/ol> and the first if any found is used. (Adding <q><code>-precomposed<\/code><\/q> to the name asks software not to tweak the image.)<\/p> <p>Originally, the Apple Touch icon was to be 57&times;57.  Now, for higher resolution iPods and iPhones, and for iPads, one is urged to <em>also<\/em> supply 114&times;114 images (for higher resolution iPods and iPhones) and 72&times;72 images (for iPads). And, since this entry was first posted, there is a further standard size of 144&times;144; I am editting this series accordingly.<\/p> <p> <\/p><p>The original tag for specifying an Apple Touch icon was of form<\/p> <blockquote style=\"width: 91%; overflow: auto ; white-space: nowrap ;\"><code>&lt;link rel=&#34;apple-touch-icon&#34; href=&#34;<\/code><var>image<abbr title=\"Uniform Resource Locator\">URL<\/abbr><\/var><code>&#34; \/&gt;<\/code><\/blockquote> <p>or (again using <q><code>-precomposed<\/code><\/q>)<\/p> <blockquote style=\"width: 91%; overflow: auto ; white-space: nowrap ;\"><code>&lt;link rel=&#34;apple-touch-icon-precomposed&#34; href=&#34;<\/code><var>image<abbr title=\"Uniform Resource Locator\">URL<\/abbr><\/var><code>&#34; \/&gt;<\/code><\/blockquote> <p>typically<\/p> <blockquote style=\"width: 91%; overflow: auto ; white-space: nowrap ;\"><code>&lt;link rel=&#34;apple-touch-icon&#34; href=&#34;\/apple-touch-icon.png&#34; \/&gt;<\/code><\/blockquote> <p>In order to support icons of different resolutions, a <code>sizes<\/code> attribute was introduced.  its values are of form<\/p> <blockquote style=\"width: 91%; overflow: auto ; white-space: nowrap ;\"><var>width<\/var><code>x<\/code><var>height<\/var><\/blockquote> <p>as in <blockquote style=\"width: 91%; overflow: auto ; white-space: nowrap ;\"><code>&lt;link rel=&#34;apple-touch-icon&#34; sizes=&#34;72x72&#34; href=&#34;\/apple-touch-icon-72x72.png&#34; \/&gt;<\/code><\/blockquote> <\/p><p>(In the absence of this attribute, an icon is presumed to have a 57&times;57 resolution.) Multiple resolutions are supported by multiple tags (with associated images).<\/p> <p>Reasonable webdesign will employ a distinct image and distinct tag for each resolution supported by this class of devices,<\/p> <blockquote style=\"width: 91%; overflow: auto ; white-space: nowrap ;\"><code>&lt;link rel=&#34;apple-touch-icon&#34; href=&#34;apple-touch-icon-57x57.png&#34; \/&gt;<br \/>&lt;link rel=&#34;apple-touch-icon&#34; sizes=&#34;72x72&#34; href=&#34;apple-touch-icon-72x72.png&#34; \/&gt;<br \/>&lt;link rel=&#34;apple-touch-icon&#34; sizes=&#34;114x114&#34; href=&#34;apple-touch-icon-114x114.png&#34; \/&gt;<br \/>&lt;link rel=&#34;apple-touch-icon&#34; sizes=&#34;144x144&#34; href=&#34;apple-touch-icon-144x144.png&#34; \/&gt;<\/code><\/blockquote> <p>and perhaps for whatever seems to be coming down the pike.  Given that one is using these tags, I don't think that there is a particular need to have a fall-back image in the highest-level directory.<\/p> <h4>Site Thumbnail Images<\/h4> <p>Site thumbnail images are used when some other websites, such as <a href=\"https:\/\/www.facebook.com\/\">Facebook<\/a>, link to the site with a thumbnail. <img loading=\"lazy\" decoding=\"async\" src=\"wp-content\/uploads\/2011\/02\/facebooklink.jpg\" alt=\"\" width=\"393\" height=\"86\" style=\"border: 0 ; display: block ; margin-top: 1em ; margin-bottom: 1em ; margin-left: auto ; margin-right: auto ;\" \/> In the absence of a specifying tag, some sites will try to find a suitable image, but may fail, or may choose one that the site owner would prefer not be used in such manner.<\/p> <p>Some sites look for a tag of form<\/p> <blockquote style=\"width: 91%; overflow: auto ; white-space: nowrap ;\"><code>&lt;link rel=&#34;image_src&#34; href=&#34;<\/code><var>image<abbr title=\"Uniform Resource Locator\">URL<\/abbr><\/var><code>&#34; type=&#34;image\/<\/code><var>mimeImageSubtype<\/var><code>&#34; \/&gt;<\/code><\/blockquote> <p>such as<\/p> <blockquote style=\"width: 91%; overflow: auto ; white-space: nowrap ;\"><code>&lt;link rel=&#34;image_src&#34; href=&#34;&#104;ttp:\/\/www.oeconomist.com\/blogs\/daniel\/thumbnail_graphic.png&#34; type=&#34;image\/png&#34; \/&gt;<\/code><\/blockquote> <p>Others look for a tag of form<\/p> <blockquote style=\"width: 91%; overflow: auto ; white-space: nowrap ;\"><code>&lt;meta property=&#34;og:image&#34; content=&#34;<\/code><var>image<abbr title=\"Uniform Resource Locator\">URL<\/abbr><\/var><code>&#34; \/&gt;<\/code><\/blockquote> <p>such as<\/p> <blockquote style=\"width: 91%; overflow: auto ; white-space: nowrap ;\"><code>&lt;meta property=&#34;og:image&#34; content=&#34;&#104;ttp:\/\/www.oeconomist.com\/blogs\/daniel\/thumbnail_graphic.png&#34; \/&gt;<\/code><\/blockquote> <p>Naturally, I recommend that <em>both<\/em> tags be used.<\/p> <p>For <a href=\"https:\/\/www.facebook.com\/\">Facebook<\/a>, images should be in the <abbr title=\"Portable Network Graphics\">PNG<\/abbr> format, in <abbr title=\"Joint Photographic Experts Group\">JPEG<\/abbr> <abbr title=\"File Interchange Format\">FIF<\/abbr>, or in <abbr title=\"Graphics Interchange Format\">GIF<\/abbr>; and be at least 50&times;50, with an aspect ratio no greater than 3-to-1.  I don't know what might obtain elsewhere.<\/p> <p>The same image file as is used for an Apple Touch icon might be quite suitable as the site thumbnail image.<\/p> <p><a href=\"?page_id=4424\"><span style=\"font-style: bolder ; font-variant: small-caps ;\">Next:<\/span> Working Code and How to Use It<\/a><\/p> <p style=\"text-align: right ;\"><a href=\"?p=4489#respond\">Comments<\/a><\/p>","protected":false},"excerpt":{"rendered":"This page is the first part of a discussion on supporting favicons, Apple Touch icons, and site thumbnail images. First, I'll try to explain the r&ocirc;les and invocations of these images without peculiar reference to WordPress or to PHP. If you're already quite familiar with these three sorts of graphics and with the HTML to [&hellip;]","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"class_list":["post-4400","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.oeconomist.com\/blogs\/daniel\/index.php?rest_route=\/wp\/v2\/pages\/4400","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.oeconomist.com\/blogs\/daniel\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.oeconomist.com\/blogs\/daniel\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.oeconomist.com\/blogs\/daniel\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.oeconomist.com\/blogs\/daniel\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4400"}],"version-history":[{"count":0,"href":"https:\/\/www.oeconomist.com\/blogs\/daniel\/index.php?rest_route=\/wp\/v2\/pages\/4400\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.oeconomist.com\/blogs\/daniel\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4400"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}