09/08/2012, 00:52
|
| | Fecha de Ingreso: diciembre-2011
Mensajes: 29
Antigüedad: 12 años, 11 meses Puntos: 1 | |
Respuesta: Como puedo editar Permalinks de wordpress Hola
antes que nada gracias por tu ayuda
en la pagina que me enviates encontre algo pero nose donde va o como es esto o si es algun plugin
http://codex.wordpress.org/Function_Reference/WP_Rewrite
Examples
(See also: Permalinks for Custom Archives) The most obvious thing a plugin would do with the $wp_rewrite object is add its own rewrite rules. This is remarkably simple. Filter the generic rewrite_rules_array.
A Quick and dirty example for rewriting http://mysite/project/1 into http://mysite/index.php?pagename=project&id=1:
me quedaria algo haci}
http://localhost/InRG/index.php?pagename=project&id=1:
no se si me podrias indicar donde va esto o si es algun plugin
add_filter( 'rewrite_rules_array','my_insert_rewrite_rules' );
add_filter( 'query_vars','my_insert_query_vars' );
add_action( 'wp_loaded','my_flush_rules' );
// flush_rules() if our rules are not yet included
function my_flush_rules(){
$rules = get_option( 'rewrite_rules' );
if ( ! isset( $rules['(project)/(\d*)$'] ) ) {
global $wp_rewrite;
$wp_rewrite->flush_rules();
}
}
// Adding a new rule
function my_insert_rewrite_rules( $rules )
{
$newrules = array();
$newrules['(project)/(\d*)$'] = 'index.php?pagename=$matches[1]&id=$matches[2]';
return $newrules + $rules;
}
// Adding the id var so that WP recognizes it
function my_insert_query_vars( $vars )
{
array_push($vars, 'id');
return $vars;
} |