WP-Basics es un theme para WordPress que propone una estructura básica de ficheros y de ficheros para generar themes más facilmente intentado conseguir una estandarización en la creación de themes.
Existe un proyecto en Google Code en el que se puede descargar el código para echarle un vistazo. Basicamente se trata de un theme completo que podemos personalizar fácilmente mediante CSS, sin llegar a ser un framework de themes.
Aprovechando este proyecto, Frank de WP-Engineer.com ha creado un proyecto paralelo en el que está adaptando el theme al nuevo estandar HTML5. Simplemente está añadiendo los tags <article />
, <section />
y demás atributos integrados en el estandar.
[...]
<?php while ( have_posts() ) : the_post(); ?> <article <?php if ( function_exists('post_class') ) { post_class(); } else { _e( 'class="post"'); } ?> id="post-<?php the_ID(); ?>"> <h2><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2> <section class="story"> <?php if ( is_archive() || is_search() ) { ?> <?php the_excerpt() ?> <p class="textright"><a href="<?php the_permalink() ?>" rel="bookmark"><?php _e( '... weiterlesen »', FB_BASIS_TEXTDOMAIN ); ?></a></p> <section class="info"> <p><?php _e( 'Aktualisiert am', FB_BASIS_TEXTDOMAIN ); ?> <time datetime="<?php the_modified_date('Y-m-d'); ?>"><?php the_modified_date(); ?></time> <?php edit_post_link( __( 'Editieren', FB_BASIS_TEXTDOMAIN ),' · ', ''); ?></p> </section> <?php } else { ?> <?php the_content( the_title( '', '', false ) . ' ' . __( 'weiterlesen »', FB_BASIS_TEXTDOMAIN ) ); ?> <section> <?php wp_link_pages(); ?> </section> <?php } ?> </section> </article> <?php endwhile; else: ?> [...]
Basta con echarle un pequeño vistazo al código para ver la mejoría semántica con respecto a lo que estabamos usando hasta ahora. Y eso, teniendo en cuenta que es de lo primero que sale al respecto, ya que aún se podrá mejorar más.
<article <?php if ( function_exists(‘post_class’) ) { post_class(); } else { _e( ‘class=»post»‘); } ?> id=»post-<?php the_ID(); ?>»>
<h2><a href=»<?php the_permalink() ?>» rel=»bookmark»><?php the_title(); ?></a></h2>
<section class=»story»>
<?php if ( is_archive() || is_search() ) { ?>
<?php the_excerpt() ?>
<p class=»textright»><a href=»<?php the_permalink() ?>» rel=»bookmark»><?php _e( ‘… weiterlesen »’, FB_BASIS_TEXTDOMAIN ); ?></a></p>
<section class=»info»>
<p><?php _e( ‘Aktualisiert am’, FB_BASIS_TEXTDOMAIN ); ?> <time datetime=»<?php the_modified_date(‘Y-m-d’); ?>»><?php the_modified_date(); ?></time> <?php edit_post_link( __( ‘Editieren’, FB_BASIS_TEXTDOMAIN ),’ · ‘, »); ?></p>
</section>
<?php } else { ?>
<?php the_content( the_title( », », false ) . ‘ ‘ . __( ‘weiterlesen »’, FB_BASIS_TEXTDOMAIN ) ); ?>
<section>
<?php wp_link_pages(); ?>
</section>
<?php } ?>
</section>
</article>
<?php endwhile; else: ?>
4 comentarios, 0 referencias
+
#