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 ) );