Javascript 探测客户设备的操作系统 var deviceAgent = navigator.userAgent.toLowerCase(); var isAndroid = deviceAgent.indexOf("android") > -1; //&& ua.indexOf("mobile"); var iOS = deviceAgent.match(/(iphone|ipod|ipad)/); if (iOS) { document.write('iOS'); } else if(isAndroid) { document.write('android'); }else { document.write(navigator.platform); } php 探测客户设备的操作系统 //Detect special conditions devices $iPod = stripos($_SERVER['HTTP_USER_AGENT'],"iPod"); $iPhone = stripos($_SERVER['HTTP_USER_AGENT'],"iPhone"); $iPad = stripos($_SERVER['HTTP_USER_AGENT'],"iPad"); if(stripos($_SERVER['HTTP_USER_AGENT'],"Android") && stripos($_SERVER['HTTP_USER_AGENT'],"mobile")){ $Android = true; }else [...]
实际上这是个插件叫 Disable Updates,但是想就这点代码直接写在主题的功能文件里倒来得更加方便:
The Feed templates are located in the /wp-includes/feed-{type}.php files and include formats for rdf, rss, rss2 and atom. 这儿是一些默认的 rss 模板,定制自己的模板时可以参照。

Posted on 24, 十一











