WordPress.org

Forums

Responsive
[resolved] Mobile specific content? (3 posts)

  1. JanOnDemand
    Member
    Posted 2 years ago #

    I'm trying to get the "featured" div on the first page to display a certain slider (basically just output a certain shorthand string) for mobile devices and another one for other screens. (The slider is too wide to look good on mobile devices.)

    I've tried to insert a javascript in the content field for the home page, but it fails to work properly. Does anyone have a clue on what I've done wrong? - Btw, I suck at javascript.

    <script language="javascript">
    	var mobile = (/iphone|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase()));
    		if (mobile)
    			document.write("[unoslider id=\'2\']");
    		else
    			document.write("[unoslider id=\'1\']");
    </script>

    I'd be grateful for any input anyone has. This has me a bit stumped.

  2. Emil Uzelac
    Theme Review Admin
    Posted 2 years ago #

    Please see: http://themeid.com/help/discussion/2323/featured-slider-slideshow-and-shortcode-support and feel free to post to our dedicated forum directly :)

    Thanks,
    Emil

  3. JanOnDemand
    Member
    Posted 2 years ago #

    Will continue this discussion on the dedicated forum, thanks!

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags

No tags yet.