Support » Theme: Twenty Seventeen » How can I hide featured images on mobile view

  • titimachine

    (@titimachine)


    Good day admin, please how can I hide featured images for mobile view on my site as it takes lots of data to load them. Please I need help, my site is iminathi.com

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • bbtodd

    (@bbtodd)

    FYI – using CSS to hide the image won’t actually stop the browser from loading that data, it just won’t show it.

    You should look up wp_is_mobile()
    https://codex.wordpress.org/Function_Reference/wp_is_mobile

    Find the part of the code where the featured image is loaded, probably header php and use this:
    <?php
    if ( wp_is_mobile() ) {
    /* If mobile do nothing/do not load featured image */
    } else {
    /* Not a mobile device, put the code here that inserts the featured image */
    }
    ?>

    • This reply was modified 1 year ago by bbtodd.
Viewing 1 replies (of 1 total)
  • The topic ‘How can I hide featured images on mobile view’ is closed to new replies.