• Resolved BehindTheThrills

    (@behindthethrills)


    I want to implement a conditional comment into my wordpress site to target versions 9 and earlier for internet explorer to fix where my sidebar is placed.

    I’m unsure how to go about doing this. I have the conditional comment code and I made a new css file for the stylesheet, but how do I connect them to only fix my sidebar? Is there a special string of code I need to call the sidebar?

Viewing 6 replies - 1 through 6 (of 6 total)
  • You need to target your CSS rules at the sidebar’s classes only.

    Thread Starter BehindTheThrills

    (@behindthethrills)

    Could I do that with a div id?

    Whether you use classes or ids is up to you.

    Thread Starter BehindTheThrills

    (@behindthethrills)

    Ok.. I saved my CSS in ie.css within my site, and put this code in my header:

    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    <!--[if lte IE 9]>
    <link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/ie.css" media="screen" type="text/css" />
    <![endif]-->

    and I put

    <div class="internetexplorer">...</div>

    in the sidebar.php file and it doesn’t seem to be working. Am I doing this correctly? I’m using https://netrenderer.com/ to view older versions of IE since I have IE 10 and my website displays correctly on the latest version.

    Am I doing this correctly?

    No. You do not add any extra markup to your theme templates. You just use the pre-existing classed and ids in your IE-specific stylesheet.

    Thread Starter BehindTheThrills

    (@behindthethrills)

    I removed the extra markups I added and changed my IE-specific stylesheet to have #primary and #secondary since that’s what’s in the sidebar.php file.

    It’s still not working for me. Thanks for the help though.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Implementing conditional comments into WordPress?’ is closed to new replies.