Linux 软件免费装
Banner图

Nginx Mobile Theme

开发者 miyauchi
megumitheme
amimotoamis
更新时间 2018年10月17日 17:01
PHP版本: 3.7.1 及以上
WordPress版本: 4.9.8

标签

theme mobile iphone android smartphone tablet ipad nginx

下载

1.0.0 1.1.0 1.2.0 1.3.0 1.4.0 1.5.0 1.6.0 1.7.0 1.8.0 1.8.1 1.8.2

详情介绍:

This plugin allows you to switch theme according to the User Agent on the Nginx reverse proxy. Nginx Mobile Theme's requirements are as follows. Some Features Nginx Configuration Add mobile device detection to the nginx.conf. set $mobile ''; if ($http_user_agent ~* '(iPhone|iPod|incognito|webmate|Android|dream|CUPCAKE|froyo|BlackBerry|webOS|s8000|bada|IEMobile|Googlebot\-Mobile|AdsBot\-Google)') { set $mobile "@smartphone"; } Set proxy_cache_key. proxy_cache_key "$mobile$scheme://$host$request_uri"; Send custom request header to the backend. proxy_set_header X-UA-Detect $mobile; Nginx Mobile Theme will switch theme when '@smartphone' is received in the $_SERVER['HTTP_X_UA_DETECT']. How to use
  1. Please access to the theme-customizer in the WordPress admin area.
  2. Please select Mobile Theme in the drop-down.
  3. Click "Save & Publish" button to save.
Multiple mobile device support
  1. Add custom mobile detection to the nginx.conf.
  2. Add custom mobile detection to the WordPress via nginxmobile_mobile_detects filter-hook.
nginx.conf: set $mobile ''; if ($http_user_agent ~* '(iPhone|iPod)') { set $mobile "@smartphone"; } if ($http_user_agent ~* 'iPad') { set $mobile "@tablet"; } In your custom plugin: add_filter('nginxmobile_mobile_detects', function(){ return array('@smartphone', '@tablet'); }); Amimoto Support The Amimoto is a full-tuned WordPress AMI on the AWS EC2. before: #include /etc/nginx/mobile-detect; after: include /etc/nginx/mobile-detect; before: proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Accept-Encoding ""; after: proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Accept-Encoding ""; proxy_set_header X-UA-Detect $mobile; # add new line define('IS_AMIMOTO', true);

安装:

  1. Upload nginx-mobile-theme to the /wp-content/plugins/ directory.
  2. Activate the plugin through the 'Plugins' menu in WordPress.

屏幕截图:

  • theme-customizer

更新日志:

1.8.1 1.5.0 1.4.0 1.3.0 1.2.0 1.1.0 1.0.0