
內容簡介
「Specific Content For Mobile」外掛可以讓你針對手機版頁面和文章創建特定的內容。若某些頁面需要有不同的內容,這款外掛就非常適合你使用。雖然擁有一個完全回應式的設計是有安裝手機版的最佳方法,但有時候你可能需要為手機版創建特定的內容。
要如何新增或刪除手機版特定內容:
- 點擊管理員主選單中的「頁面」
- 在頁面列表中將滑鼠移至你想要為手機版修改的頁面上,然後點擊「建立手機版本」的動作連結,或點擊設備欄中所見「+」圖示
- 根據需要修改手機版頁面
- 儲存手機版頁面
如果你想為部落格文章創建手機版,也是同樣的方法,只需要進入「文章」列表。
這個外掛會在手機裝置上載入你為該頁面或文章創建的手機版。如果你為一個網站可到達的頁面「https://your-domain.com/page-example/」創建了手機版,而且你已經登錄,你還會看到「https://your-domain.com/page-example-mobile/」。但未登錄的用戶將看不到它,而且唯一存在於公共面前的URL是「https://your-domain.com/page-example/」。頁面在桌面裝置上會顯示桌面版內容,在手機上會顯示手機版內容,而URL則始終保持不變。你不需要任何重定向,這個外掛僅會用手機版內容替換相關桌面版本的內容。
使用本外掛需要注意以下幾點限制:
- 目前版本只支援手機版頁面和文章,不支援自訂文章型態、存檔和術語。
- 如果你使用了一個伺服器快取外掛,請確保為手機裝置設置一個不同的伺服器快取處理。否則,你的頁面的手機版可能也會在桌面裝置上服務。例如,W3 Total Cache、WP Fastest Cache 和 Powered Cache 都是可以處理手機快取的外掛。
此外,這個外掛與AMP(加速移動頁面)外掛不同,並不會生成任何AMP標記,也不需要任何重定向。如果你想提供AMP頁面,「Specific Content For Mobile」是不適合你使用的。在這種情況下,你可能會對AMP或AMP For WP等外掛感興趣。你可以將「Specific Content For Mobile」視為AMP外掛的一種替代方案。
最後,這個外掛默認同步文章元數據。也就是說,當你儲存一篇文章或頁面時,如果它們有一個手機版,相同的元數據將被儲存在手機版中。同樣地,當你儲存手機版時,手機版元數據也會被保存到桌面版中。如果你想改變這個行為,請前往「Specific Content For Mobile」的設置並選擇「允許手機版有不同的元數據」。
外掛標籤
開發者團隊
② 後台搜尋「Specific Content For Mobile – Customize the mobile version without redirections」→ 直接安裝(推薦)
📦 歷史版本下載
原文外掛簡介
Specific Content For Mobile allows you to create pages and posts content designed for mobile devices.
This plugin DOES NOT redirect content from the desktop website: it creates brand new mobile-specific content.
It’s perfect if in some pages you need different content for the mobile version.
The best way to have a mobile version is always a fully responsive design, but in some cases you may need specific content for the mobile version.
How to add or remove specific content for the mobile version:
Click on Pages in the main admin menu
Go with your mouse on the page you want to modify for the mobile version and click on the action link “Create mobile version”, or click on the icon “+” you see in the devices column
Modify your page as you want to see it on mobile
Save your page mobile version
If you want to create a mobile version for your blog posts, do as explained above, but going to the list of Posts.
On mobile devices, the plugin will load the mobile version you have created for that page or post.
If you create the mobile version for a page reachable at https://your-domain.com/page-example/, and you are logged-in, you will see also https://your-domain.com/page-example-mobile/.
But logged-out users will not see it, and the only URL that exists for the public is https://your-domain.com/page-example/.
The page reachable at https://your-domain.com/page-example/ will show the desktop content on desktop devices, and the mobile content on mobile devices The URL is always the same.
You have no redirections, and the plugin just replaces the desktop content with the related mobile version.
For more details read the Documentation.
Requirements
If you have a server cache plugin, be sure to set a different server cache handling for mobile devices, in another case the mobile version of your pages could also be served on desktop devices.
E.g. W3 Total Cache, WP Fastest Cache, and Powered Cache are caching plugins that can handle the mobile cache.
Be careful if you are using W3 Total Cache or whatever other caching plugin that gives you the possibility to manage the mobile version, DO NOT set up any redirection for mobile devices.
If you have issues with the mobile and desktop versions with W3 Total Cache, read Mobile version showing in desktop view – W3 Total Cache Plugin
Specific Content For Mobile DOES NOT redirect the mobile users. The URL of a page visited on mobile is exactly the same as the desktop URL.
Differences with AMP plugins
Specific Content For Mobile has nothing to do with AMP pages. It gives you the possibility to show specific content for mobile, but without any redirection, and without generating any AMP markup.
If you want to serve AMP pages, Specific Content For Mobile is not for you. In that case, you may be interested in a plugin like AMP, or AMP For WP.
You consider Specific Content For Mobile like an alternative to AMP plugins.
Limitations of the free version
The free version supports only the mobile version of pages and posts, no custom post types, no archives, no terms.
I need advanced functionality to be integrated with this plugin.
If you need custom functionality, I offer a development service for WordPress plugin integrations and advanced feature extensions.
Learn more about advanced functionality for WordPress.
Additional information
As a default, WordPress doesn’t output the blog page content before the posts loop.
Some themes do it. In this case, the blog page content output before the loop is handled by the theme templates.
The plugin will check if the theme declares support for the blog page mobile version, if not so the blog page mobile version may take the original desktop content.
As a default Specific Content For Mobile synchronizes the post metadata. This means that when you save a post or page, if they have a mobile version, the same metadata will be saved in the mobile version.
When you save a mobile version, the mobile version metadata will be saved also in the desktop version.
If you want to change this behavior, go to Specific Content For Mobile settings and choose “Allow mobile versions having their own metadata”.
For the most popular SEO plugins, you can choose the metadata synchronization specifically for that plugin.
PRO Version
The PRO version also allows you to:
Have a mobile version of all the queriable post types are supported
Load a different theme specifically on mobile devices
Unload specific plugins only on mobile devices
Decide if tablets should be considered as mobile devices or not so
Have a different navigation on mobile
Write specific content depending on the device
Have access to the premium support
For developers
Template for mobile
If you need to use a different template file on mobile, copy the template file of your theme and put it in one of these folders:
wp-content/scfm/
wp-content/themes/theme-name/scfm
For example, if your theme is “theme-name” and you want to load a different page.php on mobile, it will be something that looks like:
wp-content/scfm/page.PHP
or
wp-content/themes/theme-name/page.php
In the case of mobile devices, Specific Content For Mobile will look for the custom template file first in wp-content/themes/theme-name/scfm and if it doesn’t find it in wp-content/scfm.
Integration with other plugins
If you add an option for the metadata synchronization of an external plugin, you can use the filter “eos_scfm_meta_integration_array”.
Here an example:
add_filter( 'eos_scfm_meta_integration_array','my_custom_scfm_meta_integration',20,2 );
//It adds an option to synchronize your plugin meta data.
function my_custom_scfm_meta_integration( $arr,$options ){
$slug = 'my_custom_meta';
$arr[$slug] = array(
'is_active' => defined( 'WPSEO_FILE' ),
'args' => array(
'title' => __( 'My custom meta synchronization','my-textdomain' ),
'type' => 'select',
'value' => isset( $options[$slug] ) ? esc_attr( $options[$slug] ) : 'synchronized',
'options' => array(
'synchronized' => __( 'Synchronize desktop and mobile metadata','my-textdomain' ),
'separated' => __( 'Allow mobile versions having their own metadata','my-textdomain' )
),
),
'prefix' => array( '_my_plugin' ),
'default' => 'synchronized'
);
return $arr;
}
Then you will see your custom option “My custom meta synchronization” in the main settings page.
Helper functions
In your theme, you can use the following functions to give full support to the mobile version content:
eos_scfm_related_desktop_id( $post_id );
given the post ID, it will get the post ID of the related desktop version.
eos_scfm_related_mobile_id( $post_id );
given the post ID, it will get the post ID of the related mobile version.
Theme support
To add the theme support to the blog content, you can add this line in your theme support action hook:
add_theme_support('specific_content_form_mobile',array( 'posts_page' => true ) );
Help
If something doesn’t work on the free version, open a thread on the support forum
If you are a PRO user, and you have issues, don’t hesitate to open a ticket on the premium support
