type de message personnalisé et taxonomie personnalisée permalien
-
-
juste unenote:je crois que lenom «type»pour unetaxonomiepersonnaliséeest unterme réservéet peut causer desproblèmes http://codex.wordpress.org/Function_Reference/register_taxonomy#Reserved_Termsjust a note: I believe that the name 'type' for a custom taxonomy is a Reserved Term and can cause problems http://codex.wordpress.org/Function_Reference/register_taxonomy#Reserved_Terms
- 1
- 2011-06-15
- Bainternet
-
bonjour .. cen'est qu'unexemple,surmon code,le vrainom de lataxonomieest "genre".hi there.. this is just a sample, on my code, the real name of the taxonomy is "genre".
- 0
- 2011-06-16
- Homem Robô
-
Salut @ HomemRobô,est-ceencore une question ouverte?Je serais heureux de vous aider à régler ceproblème si c'est le cas.Sinon,ce seraitformidable si vouspouviezpublier votre solutionpour d'autres!Hi @HomemRobô, is this still an open question? I'd be happy to help you sort this out if it is. If not, it would be great if you could post your solution for others!
- 0
- 2012-01-30
- Matthew Boynes
-
1 réponses
- votes
-
- 2012-03-02
Quelque chose de similaire dans votrefunctions.php ou dans unpluginfera l'affaire:
function custom_rewrite( $wp_rewrite ) { $feed_rules = array( '([^/]+)/cases/([^/]+).html' => 'index.php?genre='. $wp_rewrite->preg_index(1) .'&case='. $wp_rewrite->preg_index(2) ); $wp_rewrite->rules = $feed_rules + $wp_rewrite->rules; } // refresh/flush permalinks in the dashboard if this is changed in any way add_filter( 'generate_rewrite_rules', 'custom_rewrite' );
Vous devrez actualiser/vider vospermaliens (WP Dashboard> Paramètres> Permaliens> Enregistrer lesmodifications) lorsque vous ajoutez/modifiez/supprimez ce code.Vous devrezpeut-être l'ajuster légèrement s'ilne fonctionnepastel quel,mais cela démontre leprincipe debase de lafaçon de lefaire.
Something similar to this in your functions.php or a plugin will do the trick:
function custom_rewrite( $wp_rewrite ) { $feed_rules = array( '([^/]+)/cases/([^/]+).html' => 'index.php?genre='. $wp_rewrite->preg_index(1) .'&case='. $wp_rewrite->preg_index(2) ); $wp_rewrite->rules = $feed_rules + $wp_rewrite->rules; } // refresh/flush permalinks in the dashboard if this is changed in any way add_filter( 'generate_rewrite_rules', 'custom_rewrite' );
You will need to refresh/flush your permalinks (WP Dashboard > Settings > Permalinks > Save Changes) when you add/edit/remove that code. You may need to adjust it slightly if it doesn't work as is, but it demonstrates the basic principle of how to do it.
J'ai 2pages.
J'ai untype demessagepersonnalisé,appelé "cas":
Etenfin j'ai unetaxonomiepersonnalisée,appelée "type":
Tousmestypes ont lemêmenom quemespages: client-a,client-b.
Commentpuis-je réécrire les règles depermalienpour accepter cette structure:
Quelleest lameilleure approchepour cette structure?
Pourquoij'utilise cette solution: http://xplus3.net/2010/05/20/wp3-custom-post-type-permalinks/comment-page-1/#comment-1005
Merci!