Forums

[resolved] Conditional tag breaks Ie6 (5 posts)

  1. ravnblade
    Member
    Posted 2 years ago #

    Hey Fellow bloggers, I have really weird problem which is causing me to nearly run my head into the wall. Hopefully one of you guys can help me out.

    Here's the deal. I use excerpts on my main page and show the full post when a reader clicks to read the rest. For this I decided it would be easy to use the following code :

    <div class="entry_content" style="
    <?php if (is_single())
    {echo 'display:none;';} ?>">
    <?php the_excerpt(); ?>
    </div>

    <div class="entry_content" style="
    <?php if (is_home())
    {echo 'display:none;';} ?>">
    <?php the_content(); ?>
    </div>

    Basically this code hides the full content if we're on the home page and in turn hides the excerpt if the user is on a single page. This works flawless in firefox but gets really messed up in IE6(havent tested 7) where it ads huge weird spaces and duplicates some of the content.

    Is this anything anyone has ever experienced? Is there perhaps a better way to deal with conditional tags?

    Thanks in advance!

  2. moshu
    Member
    Posted 2 years ago #

    Wouldn't be simpler to just use the index.php for the main page and have a single.php for displaying the single posts? No conditional, no complications. WP "knows" if a single.php is present and it will use it to display your posts in single post view.
    Learn more: Template_Hierarchy

  3. Root
    Member
    Posted 2 years ago #

    I would dump that whole theme. The code is really sucky. When we have php turning out CSS we need to quit and get a better job.

  4. ravnblade
    Member
    Posted 2 years ago #

    Moshu : Thnx, I have a lot to learn about wp, this is my first real blog. I'll give your solution a go, definately sounds much leaner.

    Root : It's my own theme, I'm not dumping it lol:P

  5. ravnblade
    Member
    Posted 2 years ago #

    Worked like a charm - resolved -
    Thanks for the quick response!

Topic Closed

This topic has been closed to new replies.

About this Topic