He creado hijo del tema veinte. Intenté anular la función escrita a continuación
/**
* Returns a "Continue Reading" link for excerpts
*
* @since Twenty Ten 1.0
* @return string "Continue Reading" link
*/
function twentyten_continue_reading_link() {
return ' <a href="'. get_permalink() . '">' . __( 'Continue reading <span class="meta-nav">→</span>', 'twentyten' ) . '</a>';
}
/**
* Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis and twentyten_continue_reading_link().
*
* To override this in a child theme, remove the filter and add your own
* function tied to the excerpt_more filter hook.
*
* @since Twenty Ten 1.0
* @return string An ellipsis
*/
function twentyten_auto_excerpt_more( $more ) {
return ' …' . twentyten_continue_reading_link();
}
add_filter( 'excerpt_more', 'twentyten_auto_excerpt_more' );
Dice que se anule esto en un tema secundario, elimine el filtro y agregue su propia función vinculada al gancho del filtro excerpt_more. No quiero hacer ningún cambio en la carpeta del tema principal, por lo que he creado functions.php en la carpeta del tema secundario. Escribo mi función en el archivo secundario functions.php como se muestra a continuación
f
function twentyten_continue_reading_link_() {
return ' <a href="'. get_permalink() . '">' . __( 'READ MORE', 'twentyten' ) . '</a>';
}
function twentyten_auto_excerpt_more_( $more ) {
return ' …' . twentyten_continue_reading_link_();
}
add_filter( 'excerpt_more', 'twentyten_auto_excerpt_more_' );
Pero tengo que comentar el filtro escrito en el padre para hacer que el nuevo funcione. Es posible hacerlo sin modificar las funciones del archivo principal.php.
Cualquier ayuda será apreciada. Gracias de antemano