Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Reemplazar la url de una pagina por la categoria para SILO
function wpa_alter_cat_links( $termlink, $term, $taxonomy ){
if( 'category' == $taxonomy && 0 == $term->parent ){
return str_replace( '/category', '', $termlink );
}
return $termlink;
}
add_filter( 'term_link', 'wpa_alter_cat_links', 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment