French first
Ceci est mon premier plugin pour Wordpress. Enfin, le premier que je réussis.
Son principe : afficher une phrase aléatoire contenant un nombre formaté aléatoire.
Par exemple : “tous les jours je mange 12 plats de couscous” ou encore “nous sommes 13 526 421 mĂ©contents sur Terre“.
Le fichier text-randomizator.php s’installe comme un plug-in Wordpress classique (à copier dans le rĂ©pertoire wp-content/plugins puisà activer via l’interface d’administration).
Auparavant, je vous conseille d’Ă©diter le fichier avec un Ă©diteur et de modifier les phrases prĂ©-enregistrĂ©es. Le # dans la phrase correspond au nombre qui sera remplacĂ©.
Le nombre qui suit la flĂšche => correspondà la valeur maximale.
Il suffit ensuite de rajouter le code suivant dans votre page (typiquement, votre fichier sidebar.php) :
< ?php if (function_exists('text_randomizator')) { ?>
< ?php echo text_randomizator() ?>
< ?php } ?>
Bien sĂ»r, il serait utile de dĂ©finir une entrĂ©e dans votre feuille de style (CSS) pour mettre en forme l’Ă©lĂ©ment randomizator.
Télécharger le plugin ici : text-randomizator.zip (1 Ko)
English first (if you speak english)
This is my first plugin for Wordpress. Indeed, the first I manage to code.
Its goal : to display a random sentence from a list, containing a formatted randomly generated number.
For example : “each day I eat 12 plates of couscous” or “we are 13 526 421 angry people on Earth“.
The text-randomizator.php file must be installed as any standard Wordpress plug-in (copy it in the wp-content/plugins directory and activate it through admin panel).
May I suggest you to edit the file with the text editor of your choice and modify the pre-filled sentences. The # character is the placeholder that will be replaced by the random number.
The number after the arrow => represents the maximum allowed value.
Then, you have to copy the following code into your page (typically, the sidebar.php file ) :
< ?php if (function_exists('text_randomizator')) { ?>
< ?php echo text_randomizator() ?>
< ?php } ?>
Of course, it should be useful to add an entry in your stylesheet (CSS) for randomizator element.
Download the plugin here : text-randomizator.zip (1 Kb)











It’s very well and nice as an exercise, but what’s the point to this plugin? Making search bots think your posts were modified so to keep them “fresh”?
I don’t use it in posts, just on my sidebar.
I use it as other would display random Bible sentences or fortune cookies. The point is that I have now one more variable, the random number.
But you’re right, it’s my first one, it may be useless.
ah ben au contraire, c’est super utile, comme plug-in
Merci beaucoup pour ce plugin ! ^^
Si son dĂ©veloppement est toujours d’actualitĂ© alors je propose que tu fasses une partie administration depuis laquelle il serait envisageable de modifier les phrases
and what about the nice sentences you display on the comment input, when you recognize our name in our cookies ?
Is it a plug-in too ? or is it codĂ© Ă l’arrache en php ?