Eliminar fecha de publicación en posts
-
¡Hola!
Por temas de SEO, he decidido ocultar la fecha de mis posts, excepto en los que sean de hace 60 días o menos y los que se hayan modificado en ese tiempo.
En este post se explica exactamente lo que quiero hacer: http://miposicionamientoweb.es/como-eliminar-la-fecha-de-publicacion-en-wordpress/ (Quitarla sólo de los artículos más antiguos, versión actualizada abajo del todo de esa sección).
El tema está en que he localizado mi código pero no se parece mucho al que se muestra en ese artículo, y no quiero cargarme nada (aunque obviamente he hecho backup).
Este es mi código:
/**
* Prints HTML with meta information for the current post-date/time and author.
*/
function thim_posted_on() {
$time_string = ‘<time class=»entry-date published updated» datetime=»%1$s»>%2$s</time>’;
if ( get_the_time( ‘U’ ) !== get_the_modified_time( ‘U’ ) ) {
$time_string = ‘<time class=»entry-date published» datetime=»%1$s»>%2$s</time><time class=»updated» datetime=»%3$s»>%4$s</time>’;
}$time_string = sprintf( $time_string, esc_attr( get_the_date( ‘c’ ) ), esc_html( get_the_date() ), esc_attr( get_the_modified_date( ‘c’ ) ), esc_html( get_the_modified_date() )
);$posted_on = sprintf(
_x( ‘Publicado el %s’, ‘post date’, ‘cakeart’ ), ‘‘ . esc_html( $time_string ) . ‘‘
);$byline = sprintf(
_x( ‘por %s’, ‘post author’, ‘cakeart’ ), ‘<span class=»author vcard»>‘ . esc_html( get_the_author() ) . ‘</span>’
);echo ‘<span class=»posted-on»>’ . $posted_on . ‘</span><span class=»byline»> ‘ . $byline . ‘</span>’;
}endif;
if ( !function_exists( ‘thim_recipe_post_on’ ) ) :
/**
* Prints HTML with meta information for the current post-date/time and author
*/
function thim_recipe_posted_on() {
$time_string = ‘<time class=»entry-date published updated» datetime=»%1$s»>%2$s</time>’;
if ( get_the_time( ‘U’ ) !== get_the_modified_time( ‘U’ ) ) {
$time_string = ‘<time class=»entry-date published» datetime=»%1$s»>%2$s</time>’;
}$time_string = sprintf( $time_string, esc_attr( get_the_date( ‘c’ ) ), esc_html( get_the_date() ), esc_attr( get_the_modified_date( ‘c’ ) ), esc_html( get_the_modified_date() )
);$posted_on = sprintf(
_x( ‘Publicado el %s’, ‘recipe date’, ‘cakeart’ ), $time_string
);$byline = sprintf(
_x( ‘Por %s’, ‘recipe author’, ‘cakeart’ ), ‘<span class=»author vcard»>‘ . esc_html( get_the_author() ) . ‘</span>’
);¿Alguna idea de cómo puedo hacerlo?
Muchísimas gracias de antemano!
- El debate ‘Eliminar fecha de publicación en posts’ está cerrado a nuevas respuestas.