WordPress.org

Support

Support » Themes and Templates » [Resolved] Problem with featured image in IE

[Resolved] Problem with featured image in IE

  • Tasha

    @queenv

    Hi all, I have a problem with my featured images on the homepage. In IE it shows a thin line either next to or underneath the image on roll over. As if the masking is not covering the image completely. All other browsers seems to be ok.

    Any ideas what this could be please?

    http://www.granthamfarm.angelicdesign.co.uk/

    Thank you in advance!

Viewing 15 replies - 16 through 30 (of 58 total)
  • Moderator Andrew Nevins

    @anevins

    Forum moderator

    So did it resolve the issue in IE10? If so there needs to be some JavaScript added so that you can only apply this sort of styling to IE10.

    Moderator Andrew Nevins

    @anevins

    Forum moderator

    Do you have functions.php file in your Child Theme?

    Tasha

    @queenv

    Oh right! Yes it did fix the issue in IE10.

    Tasha

    @queenv

    No I don’t but I can add one?

    Moderator Andrew Nevins

    @anevins

    Forum moderator

    Can you create a functions.php file in your Child Theme?

    Tasha

    @queenv

    ok done

    Moderator Andrew Nevins

    @anevins

    Forum moderator

    Do you have an “inc” folder in your Child Theme? If not can you create one and then create another folder within that called, “js”?
    E.g:

    /myCustomizr/inc/js

    Tasha

    @queenv

    ok done

    Moderator Andrew Nevins

    @anevins

    Forum moderator

    In your “js” folder can you create a file called “ie.js”?

    Tasha

    @queenv

    ok done

    Moderator Andrew Nevins

    @anevins

    Forum moderator

    In your “ie.js” file add this:

    jQuery(document).ready(function(){
     setIEClass(10, jQuery);
    }
    
    function setIEClass($version, jQuery) {
     $=jQuery;
     if ($.browser.msie && $.browser.version == $version) {
      $("html").addClass("ie10");
     }
    }

    Moderator Andrew Nevins

    @anevins

    Forum moderator

    Which page does the issue occur in, the home page?

    Tasha

    @queenv

    ok done

    Tasha

    @queenv

    yes home page

    Moderator Andrew Nevins

    @anevins

    Forum moderator

    Add this to your Child Theme’s functions.php file:

    function myCustomizrSetIEClass() {
     if ( is_home() ) {
      wp_enqueue_script( 'setIEClass', get_template_directory_uri() . '/inc/js/ie.js', '', '1.0', true );
     }
    }
    
    add_action( 'wp_enqueue_scripts', 'myCustomizrSetIEClass' );

Viewing 15 replies - 16 through 30 (of 58 total)
  • The topic ‘[Resolved] Problem with featured image in IE’ is closed to new replies.