#

Witty Text Xtended 1.1

Witty Text is a WordPress plugin by Alexander Malov to view a randomly selected line from a textfile. The major use shurely is the displaying of random quotes. I changed a little bit of the code to support multiple textfiles through the parameters. The original used a hardcoded filename. Now you can reuse the same plugin eg. to show some quotes and at another place, to show some imageurls selected from a textfile.
Usage is quite easy:

<?php 
  if (function_exists('wittyx')) {
    wittyx('quotations.txt'); 
  } 
?>

The plugin is available here.

Tags:, , ,

3 Responses to “Witty Text Xtended 1.1” »»

  1. Comment by karin | 3:14 09.12.05|X

    Hi,

    How and where do I put everything to make this work?? It looks nice but I don’t understand your short comment.
    for instance: where exactly do I put this text you mention.

    Usage is quite easy:

    ;

  2. Comment by Secco | 14:36 09.12.05|X

    First you upload the plugin to your olugins folder (wp-content/plugins). Then you activate it in your wordpress administration interface.
    The php code above you ad on that place, where you want the random text to appear. Eg. if you want to use it like on my page, you go to the edit-theme function in the admin menu and select the Main template. There should be some code like

    <?php get_header(); ?>
    ...
    <div class="ncol"><!-- Begin of the narrow column -->
    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>
    ...

    And there you can place the above example code, so that it looks like

    <?php get_header(); ?>
    ...
    <div class="ncol"><!-- Begin of the narrow column -->

    <?php
    if (function_exists('wittyx')) {
    wittyx('quotations.txt');
    }
    ?>;

    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>
    ...

    You also can include some random selected text in your sidebar template,
    at the footer or anywhere else in your templates.
    You should place your txt file in the folder wp-content. The name of the text file has to be used in the exmaple above, where I used „wittyx(‚quotations.txt‘);“. Having a file named „my-favourite-fruits.txt“ that contains one fruitname per line, you can use it with „wittyx(‚my-favourite-fruits.txt‘);“.
    If you would like to display randomly selected images through wittyx, your text file should contain one link to an image per line, like

    <img src="http://mysite/myimages/example1.gif" width="100" height="100"/>

    By the way: the images (upper right corner) displayed on my site are generated by another plugin, the random flickr favourites, which get’s the images from my flickr.com account.
    If any further questions occure, feel free to ask.

  3. Comment by karin | 4:09 10.12.05|X

    Thanks very much!! It worked out for me with this very clear comment.No further questions from me at this point.
    Cheers, Karin

Leave a Reply »»

Note: All comments are manually approved to avoid spam. So if your comment doesn't appear immediately, that's ok. Have patience, it can take some days until I have the time to approve my comments.