We have a site using a wordpress theme called flat. When we add a page, there is an a tag that surrounds the whole page. This tag is no where located in the editor, and I assume its being pulled through php. Here is the code to the page.php template
<?php get_header(); ?>
<div id="content" class="site-content" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<h1 class="entry-title"><?php the_title(); ?></h1>
</header>
<div class="entry-content">
<?php the_content( __( 'Continue reading <span class="meta-nav">...</span>', 'flat' ) ); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-links1"><span class="page-links-title">' . __( 'Pages:', 'flat' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?>
</div>
</article>
<?php comments_template(); ?>
<?php endwhile; ?>
</div>
<?php get_footer(); ?>
Can someone tell me why this is happening. Here is link to page with issue: http://isagenixtech.com/known-issues/
HTML in chrome
<article id="post-41" class="post-41 page type-page status-publish hentry"><a>
<header class="entry-header">
<h1 class="entry-title">Known Issues</h1>
</header>
</a>
The a link surrounding the header should not be there
Much further up in the markup is this little gem:
You see the failure to properly close an
<a>
tag? This is probably what’s causing you problems further down.Of course, you won’t see this sort of thing if you just use the inspector tool, as that shows you the browser’s interpretation of the markup, including its best-guess fixes for any errors. You need to view source to see the actual HTML your server is sending the client.
There are no actual
<a>
tags in the region you’re talking about. Here’s the relevant actual markup:The browser is guessing that they should be there, and showing them to you in the inspector tool, because of your invalid markup further up the page.
If you are referring to the thing which is making your entry-content green on hovering that is because your content is inside an anchor tag. I believe this was added by you because half of the content in entry-content is not inside that anchor tag. I don’t know why but majority of your divs are also surrounded by anchor tag.
I hope this is what you were asking, If it is not please elaborate your question.