Type de message personnalisé Lien suivant / précédent?
-
-
Pourquoi l'aversionpour lesplugins?Why the aversion to plugins?
- 3
- 2011-10-19
- chrisguitarguy
-
Parce que s'il s'agit d'unplugin,iln'estpasintégré authème.Because if it is a plugin, it's not built into the theme.
- 0
- 2011-10-19
- AndrettiMilas
-
@Lucas Wynne Si vous voulez qu'il soitintégré,copiez/collez du code deplugin dans votrefichierfunctions.php dethèmes.@Lucas Wynne If you want it built in, copy/paste some plugin code into your themes functions.php file.
- 4
- 2011-10-19
- kaiser
-
@kaiseren supposantbien sûr que vous respectez les conditions de licenceet d'IP,ce quin'estpas si simple si vousproduisez unthème à vendre.@kaiser assuming of course that you keep within the license and IP conditions, which isn't that easy if you are producing a theme for sale.
- 2
- 2016-07-24
- Phill Healey
-
2 réponses
- votes
-
- 2011-10-19
Si vous avezbesoin de liens suivant/précédentpour des articles uniques,ilexiste le
next_post_link
fonctionet correspondantprevious_post_link
,les deux devraientprobablement être utilisés dans laboucle.Pour les archives,utilisez
next_posts_link
etprevious_posts_link
.Tout celafonctionnera correctement avec lestypes depublicationpersonnalisés.
If you need next/previous links for single posts, there is the built in
next_post_link
function and matchingprevious_post_link
, both of which should probably be used within the loop.For archives, use
next_posts_link
andprevious_posts_link
.All of these will work fine with custom post types.
-
Ilsne fonctionnentpas dansmonthème.They aren't working in my theme.
- 0
- 2011-10-19
- AndrettiMilas
-
D'accord.Ehbien,sans voir aucun de votre code,ilest difficile de direpourquoi.Y a-t-il deserreurs ou des avertissements PHP?Avez-vousplusieurs articlesinséréspour lesfonctionspour lesquelles récupérer le lien?Okay. Well, without seeing any of your code, it's hard to say why. Are there any PHP errors or warnings? Do you have multiple posts inserted for the functions to fetch link for?
- 3
- 2011-10-19
- chrisguitarguy
-
J'aimis àjourma question ci-dessus.I have updated my question above.
- 0
- 2011-10-19
- AndrettiMilas
-
Essayez-le avec letroisième argument TRUEet faites-lenous savoir.Try it with the third TRUE argument and let us know.
- 0
- 2011-10-19
- chrisguitarguy
-
Troisième vrai argument?Third true argument?
- 0
- 2011-10-19
- AndrettiMilas
-
Utilisez ceci ` Phpnext_post_link ('% link','Nextpost»');?> `et` `Use this `` and ``
- 0
- 2011-10-19
- chrisguitarguy
-
Celafonctionne sur destypes depublicationpersonnalisés,mais qu'enest-il de lamêmetaxonomie de lapublication actuelle?This is working on custom post types, but what about the same taxonomy of the current post?
- 0
- 2012-10-04
- jepser
-
@jepser (Seprésenteren retard à lapartieici) Vous devrez spécifier lataxonomie à utiliser comme 5ème argument.Si vousne passez que les 3premiers argumentset que vouspermettez autroisième de rester dans lamêmetaxonomie,cela échoueraprobablement car lataxonomiepar défautest `category` (que votre CPTn'aprobablementpas).Voir les articles codex liés dans la réponse.@jepser (Showing up late to the party here) You would need to specify the taxonomy to use as the 5th argument. If you only pass the first 3 arguments and enable the third to keep within the same taxonomy, it will most likely fail as the default taxonomy is `category` (which your CPT probably doesn't have). See the linked codex articles in the answer.
- 0
- 2014-02-07
- Evan Mattson
-
- 2013-11-20
<?php $prev_post = get_previous_post(); if($prev_post) { $prev_title = strip_tags(str_replace('"', '', $prev_post->post_title)); echo "\t" . '<a rel="prev" href="' . get_permalink($prev_post->ID) . '" title="' . $prev_title. '" class=" ">« Previous post<br /><strong>"'. $prev_title . '"</strong></a>' . "\n"; } $next_post = get_next_post(); if($next_post) { $next_title = strip_tags(str_replace('"', '', $next_post->post_title)); echo "\t" . '<a rel="next" href="' . get_permalink($next_post->ID) . '" title="' . $next_title. '" class=" ">Next post »<br /><strong>"'. $next_title . '"</strong></a>' . "\n"; } ?>
<?php $prev_post = get_previous_post(); if($prev_post) { $prev_title = strip_tags(str_replace('"', '', $prev_post->post_title)); echo "\t" . '<a rel="prev" href="' . get_permalink($prev_post->ID) . '" title="' . $prev_title. '" class=" ">« Previous post<br /><strong>"'. $prev_title . '"</strong></a>' . "\n"; } $next_post = get_next_post(); if($next_post) { $next_title = strip_tags(str_replace('"', '', $next_post->post_title)); echo "\t" . '<a rel="next" href="' . get_permalink($next_post->ID) . '" title="' . $next_title. '" class=" ">Next post »<br /><strong>"'. $next_title . '"</strong></a>' . "\n"; } ?>
-
Veuillezformater vos codes/réponseset y ajouter desexplications.Please format your codes/answer and add explanation to it.
- 3
- 2013-11-20
- Maruti Mohanty
-
Quoi qu'ilen soit,je peux limiter cela à lataxonomie dans laquelle setrouve le CPT?Anyway I can limit that to the taxonomy the CPT is in?
- 1
- 2014-04-08
- gil hamer
J'ai untype depublicationpersonnalisé appeléportfolio. J'aibesoin d'un lienprécédent/suivant SANSplugin. Quelqu'un a-t-il une solution?
Exemple d'article: http://themeforward.com/demo2/archives/portfolio/boat