• Using the Validator, I tried a small tweak for a problem I was having, but the result was worse than the original problem.

    The problem: although the page looked okay on IE7, the ‘Home’ link at the bottom of the page appeared top right at the head of the second column (where Archives and Categories usually appear) in other browsers like Firefox.

    The Validator error report was:

    Line 138, Column 31: document type does not allow element “a” here
    <a href="https://doborough.com">Home</a>

    The highlighted error was the > before ‘Home’. The comment was: “The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements — such as a “style” element in the “body” section instead of inside “head” — or two elements that overlap (which is not allowed).”

    I wanted to see what would happen if I deleted the > and the result was a page that had replaced the ‘Home’ link with WordPress elements I didn’t want and which I had managed to get rid of – take a look:

    https://doborough.com/?page_id=28

    I’m baffled. Why didn’t the page revert to the way it was before the Dreadful Tweak?

Viewing 4 replies - 1 through 4 (of 4 total)
  • dobro,

    I don’t see a footer in the code and I’m curious if you deleted more than you intended to. This is uncommon, if this is a theme you might try downloading it again and adding in the missing portion.

    Thread Starter dobro

    (@dobro)

    Here’s the code for the whole back page:

    <?php
    /*
    Template Name: blossom1
    */
    ?>
    <?php get_header(); ?>
    <div id="content" class="page">
    	<?php if (have_posts()) : ?>
    	<?php while (have_posts()) : the_post(); ?>
    
    		<div class="post" id="post-<?php the_ID(); ?>">
    			<h2><?php the_title(); ?></h2><br />
    
    			<?php the_content(); ?>
    
    		</div>
    	<?php endwhile; ?>
    
    	<?php endif; ?>  
    
    </div>
    
    <?php get_footer(); ?>
    
    </div>
    
    <a href="https://doborough.com">Home</a>
    
    </div>
    Thread Starter dobro

    (@dobro)

    Should the get-footer code come after the ‘home’ link?

    Should the get-footer code come after the ‘home’ link?

    Yes, it should because the code that closes the page– the end body and end html tags– is in footer.php which is included by get_footer(). You don’t really want anything after that. get_footer should be the last line on the page.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘attempted tweak gone wrong’ is closed to new replies.