• mrrhut

    (@mrrhut)


    Is there a way I can change the theme for mobile ?

Viewing 1 replies (of 1 total)
  • Plugin Contributor Marc Lacroix

    (@marcusig)

    Hi there,

    It could be done using the filter mkl/pc/theme_id .

    E.g. replace the selected theme by ‘float’ on mobile:

    function my_prefix_change_theme_on_mobile( $theme_id ) {
    	if ( wp_is_mobile()	) {
    		return 'float';
    	}
    	return $theme_id;
    }
    add_filter( 'mkl/pc/theme_id', 'my_prefix_change_theme_on_mobile' );

    The drawback of this is that if you are using a caching plugin (which is recommended), you will have to have a separate cache for mobile devices.

    Otherwise you could override the mobile only CSS.

    Marc

Viewing 1 replies (of 1 total)
  • The topic ‘Change theme for mobile’ is closed to new replies.