• I’m modifying twentytwelve to add some functionality that can’t be done with a plugin…

    Anyhoo, I was looking at TwentTwelve’s image.php template and it has a <footer> element inside a <header> element.

    WTF? Is this on purpose? It’s definitely wrong.

    Surprised when I searched here and didn’t find a thread about this.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter darrcass

    (@darrcass)

    LOL!

    Yes, I am familiar with HTML5.

    So is w3’s validator.

    Thread Starter darrcass

    (@darrcass)

    Maybe I didn’t explain this clearly enough: Why does the image.php template file in the Twenty Twelve WP theme contain this invalid HTML 5?

    <article id="post-<?php the_ID(); ?>" <?php post_class( 'image-attachment' ); ?>>
    					<header class="entry-header">
    						<h1 class="entry-title"><?php the_title(); ?></h1>
    
    						<footer class="entry-meta">
    							<?php
    								$metadata = wp_get_attachment_metadata();
    								printf( __( '<span class="meta-prep meta-prep-entry-date">Published </span> <span class="entry-date"><time class="entry-date" datetime="%1$s">%2$s</time></span> at <a href="%3$s" title="Link to full-size image">%4$s &times; %5$s</a> in <a href="%6$s" title="Return to %7$s" rel="gallery">%8$s</a>.', 'twentytwelve' ),
    									esc_attr( get_the_date( 'c' ) ),
    									esc_html( get_the_date() ),
    									esc_url( wp_get_attachment_url() ),
    									$metadata['width'],
    									$metadata['height'],
    									esc_url( get_permalink( $post->post_parent ) ),
    									esc_attr( strip_tags( get_the_title( $post->post_parent ) ) ),
    									get_the_title( $post->post_parent )
    								);
    							?>
    							<?php edit_post_link( __( 'Edit', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?>
    						</footer><!-- .entry-meta -->
    
    						<nav id="image-navigation" class="navigation" role="navigation">
    							<span class="previous-image"><?php previous_image_link( false, __( '&larr; Previous', 'twentytwelve' ) ); ?></span>
    							<span class="next-image"><?php next_image_link( false, __( 'Next &rarr;', 'twentytwelve' ) ); ?></span>
    						</nav><!-- #image-navigation -->
    					</header><!-- .entry-header -->

    A <footer> element inside of (child of) a <header> element. This is wrong and does not validate. Is there some specific reason for doing this?

    That was a good joke though about “familiar with HTML5…” Haw haw haw.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Twenty Twelve image.php footer inside header’ is closed to new replies.