Skip to content

Instantly share code, notes, and snippets.

@nucklearproject
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nucklearproject/c4f845963bbeee624056 to your computer and use it in GitHub Desktop.
Save nucklearproject/c4f845963bbeee624056 to your computer and use it in GitHub Desktop.
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