Ver Mensaje Individual
  #1 (permalink)  
Antiguo 28/12/2013, 08:22
Avatar de Scape
Scape
 
Fecha de Ingreso: octubre-2006
Mensajes: 626
Antigüedad: 17 años, 6 meses
Puntos: 7
Que le falta a este código, me da error

Estoy intentando en un php funtions que en ciertas categorias aparezca la fecha de los artículos y en otras que aparezca el autor.

Tengo este código, pero me da error, y no se que le falta o sobra, me podéis ayudar por favor a que funcione?

function admired_posted_on() { if ( in_category( '18' ) )
printf( __( '<span class="sep"></span><time class="entry-date" datetime="%3$s" pubdate>%4$s</time></span>', 'admired' ),
esc_url( get_permalink() ),
esc_attr( get_the_time() ),
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() ),
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
sprintf( esc_attr__( 'View all posts by %s', 'admired' ), get_the_author() ),
esc_html( get_the_author() )
);
}

elseif ( in_category ('15', '20') ) {
printf( __( '<span class="by-author"> <span class="sep"> by </span> <span class="author vcard">%7$s</span></span>', 'admired' ),
esc_url( get_permalink() ),
esc_attr( get_the_time() ),
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() ),
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
sprintf( esc_attr__( 'View all posts by %s', 'admired' ), get_the_author() ),
esc_html( get_the_author() )
);
}

endif;