16 mar. 2008
WordPress – Comment Créer Plusieurs Pages Dans Un Post sans Plugin ?
Par "RedMoze" •
Classé dans WordPress
Imprimer
Envoyer @ un ami
page 1 page 2
Pour diviser un article en plusieurs pages c’est très simple, il suffit d’éditer les fichiers index.php et page.php (et single.php et theloop.php selon votre thème par défaut).
Trouvez cette ligne : <?php the_content(__(‘Lire la suite …’));?> et coller ce code <?php wp_link_pages(); ?> juste en dessous ou au dessus pour que la navigation des pages s’affiche.
Ecrire votre article et coller ce code dans Code (HTML pour WP 2.5) : <!–nextpage–> à l’endroit où vous souhaitez couper l’article.
exemple en image avec le fichier index.php du thème par défaut de WordPress :
Pages : 1 2
Mots-clefs :article, comment, Créer, exemple, fichier, index php, link, navigation, PHP, plugin, theloop, thème, Trucs et Astuces, tuto, WordPress, WordPress 2.5 Voir aussi :
Vous pouvez afficher : WordPress – Comment Créer Plusieurs Pages Dans Un Post sans Plugin ? sur votre Site, Blog ou Forum (Ctrl+C pour copier) ↓
15 Commentaires à ce jour pour “WordPress – Comment Créer Plusieurs Pages Dans Un Post sans Plugin ?”
Laisser un Message

Posté avec
Bonjour
J ai essaye de faire fonctionner votre methode ,mais cela ne fonctionne pas !! J utilise le theme kubrick , un coup de pouce serait le bienvenue.
Cordialement,
Alex
Posté avec
Je viens de tester avec le thème par défaut Kubrick et ça a fonctionné ! il suffit d’ajouter < ?php wp_link_pages(); ?> à la ligne 15 dans le fichier index.php et écrire comme l’image ci-dessous dans l’éditeur HTLM où tu veux que les liens des pages s’affichent et puis c’est tout.
Posté avec
Bonjour Jeny et MERCI pour ton aide . ,
Voici un tuto qui pourrait interesser un grand nombre de tes lecteurs dont moi le premier !!!
How to organize posts into two side by side colums
.
There are two theme files to be edited: index.php and style.css. I have just edited the default Kubrick theme, so adjust this to suit your own theme.
The basic idea is to add a “switch” so WordPress knows if you’re looking at a post which will appear in the first or second column.
In index.php I added code in four places:
Before the WordPress loop starts:
I.e. we set up the switch to start off in the first column.
Just after the WordPress loop starts:
<?php if ($col == 1) echo « »; ?>
Start a new row if we’re in the left hand column.
Inside the WordPress loop:
Add in the switch:
<div class= »post col » id= »post- »>
I.e. I added in col to the post’s class. We’ll use CSS to decide how to display posts in each column.
Just before the end of the WordPress loop:
Change the switch and the row:
<?php if ($col == 1) echo « »; (($col==1) ? $col=2 : $col=1); endwhile; ?>
The WordPress loop ends with endwhile.
Just before this, I do two things: finish the row and I make $col switch between the first or second column. If you haven’t seen code like this before, this is what it’s doing:
Are we in the first column?
Yes: Move to the second column.
No: Move to the first column.
In style.css I added three lines of code at the very bottom:
.row { clear: both; }
.col1 { width: 200px; float: left; padding: 0 10px; }
.col2 { width: 200px; float: right; padding: 0 10px; }
If you’re using a different theme, you may need to adjust the column widths and the amount of padding.
Using a row div forces the two posts to always line up with each other, even if the excerpts are different lengths.
Cordialement,
Alex
Posté avec
Bonjour Jeny ,
Est ce que le tuto que je t ai envoye te semble
interesssant pour nous tes lecteurs ?
Cordialement,
Alex
Posté avec
Intéressant OUI pour ceux qui cherchent à personnaliser leurs blogs.
J’ai testé sous WordPress version 2.7-beta1 avec le thème Kubrick et voilà ce que ça donne :
Merci pour l’info et pour les curieux c’est par ici : How to organize posts into two side-by-side columns in WordPress.
Posté avec
Bonsoir ,
Meri pour la demo .Pourrais tu nous la traduire en Francais
pour que nous tes lecteurs puissions aussi en beneficier .
Cordialement,
Alex
Posté avec
Dès que j’ai 5 minutes de libre je m’y colle…
J’ai fait un zip des fichier index.php & style.css du thème Kubrick, tu peux le télécharger et le tester (sauvegarde tes fichiers avant de tester – sinon tu peux retrouver les originaux dans toutes les dernières versions WordPress).
passe : rmz
Voilà la traduction en FR par Google : Comment organiser en deux postes côte à côte dans les colonnes WordPress.
Posté avec
MERCI POUR TOUT .
Alex
Posté avec
Bonsoir ,
Desole c est encore moi !! j espere pour la derniere
fois ( je suis nul !mais a ce point c est desesperant!!).
les changements ont bien ete faits ,tout s est bien
passe,mais comment, lorsque tu ecris les posts obtenir
le meme resultat que ta demo ?
Cordialement,
Alex
Posté avec
J’ai rien fait de spécial ! j’ai juste publié 3 articles c’est tout.
Posté avec
CA MARCHE HURRAH !!!
Posté avec
Bonjour ,
Sais tu si ton post:creer plusieurs pages ….
fonctionne avec wordpress2.6.5 ?
j ai voulu faire un essai:
navegación se han ido convirtiendo en algo
muy popular o frecuente de ver,et j obtiens ceci;
test
December 6th, 2008
navegación se han ido convirtiendo en algo
muy popular o frecuente de ver,
j ai bien ete a la ligne 15:dans index.php
--><?php the_tags('Tags: ', ', ', ''); ?> Posted in |
Desole de te deranger de nouveau !!
Merci pour ton aide.
Alex
Posté avec
desole voici la modification effectue dans header.php de mon theme kubrick:
<div class= »post » id= »post- »>
<a href= »" rel= »bookmark » title= »Permanent Link to « >
<!– by –>
resultat:test
December 6th, 2008
navegación se han ido convirtiendo en algo
muy popular o frecuente de ver,
Posté avec
scincerement j ai beaucouuuup aim
Posté avec
Dsl,
Une boucle « if » ki fini par « endwhile » ? C’est impressionant!!