WordPress.org

Ready to get started?Download WordPress

Forums

Witty Text & Hello Dolly lyrics, php witty?? (6 posts)

  1. technonut
    Member
    Posted 9 years ago #

    In reference to my post..
    Hello Dolly on index page??
    http://wordpress.org/support/10/15042
    I took Podz's suggestion and installed and activated the plugin..
    Random Witty Text
    http://www.w-a-s-a-b-i.com/archives/2004/05/27/wordpress-random-witty-text-plugin/
    My trouble is i have no idea how to fill out and place php witty and the example leaves me just as clueless.
    The readme says i can stick it anywhere in my template?
    *** Parameters ***
    <?php witty('$before', '$after'); ?>
    Example: <?php witty('<p class="witty">','); ?>
    any help would be appreciated.
    Thanks
    Technonut

  2. Mark Jaquith
    WordPress Lead Dev
    Posted 9 years ago #

    "Anywhere on your template" means "anywhere in the index.php file" as this is the file that "displays" your weblog. Try pasting that code somewhere in there and uploading the modified file.

  3. stengazette
    Member
    Posted 9 years ago #

    I have a similar problem, but only sort of. I got Witty running just find, and it is the ants pants (EXACTLY) what I was looking for with one little problem.
    As far as I can tell, it can only be called from a template. It doesn't have to be index.php as implied by the previous comment-- I've had it working in a couple different templates. But therein lies my problem-- the witty quote will appear in ALL pages that are displayed using that particular template.

    What I want to do is create a "page" or a link in my sidebar for a quote of the day kind of thing. A page showing the selected quote, but no other content. But if I put it the witty call in the page template, the quote will appear in all the "pages."

    I know I'm showing my ignorance here (old dog trying to learn the new tricks of css, wp, and php) but why can't it be tagged in page content?

    Or is there some way to call it from an independent html page?

    Or is there some way to "install" a variant page template? The "write page" screen allows you to select default, archive, or link templates. The default is
    page.php and I can easily create modified qpage.php, and get it to appear in the theme editor, but can't figure out how to get it onto the list for "write page."

    So close... but tearing my hair out by now!

    Thanks...
    SG

  4. skippy
    Member
    Posted 9 years ago #

    This tutorial (and the second in the series) might help demonstrate how to make a page template for use solely with Witty.

  5. stengazette
    Member
    Posted 9 years ago #

    Got it!! But it was a miracle. I will see if I can post a comment there on a couple of things that could be a little clearer. The problems were:

    1. My theme includes both archive.php and archives.php. It became clear that archives.php most closely matched the example.

    2. In my usual mode of starting simple I must resaved archives.php as new_archives.php . It was not clear to me that the template is actually selected according to the template name included in the file. I had left it as archives, and evidently the FIRST incidence of an "archives" template name is selected if there are other templates named "archives," regardless of the filenames.

    So... the example would have been better for me if it had said to give the template a unique name. The fact that the example starts with the archives.php file and changes the template name from "archives" to "archives template" was pretty easy to miss.

    Anyhow we're all set now and I'm grateful for the assistance.
    TKS
    SG

  6. stengazette
    Member
    Posted 9 years ago #

    Thread might be dead, but who knows. I can now report that I have two separate implementations of Witty Text on my site, as "pages" links. The first one described above was my learning curve and the second one is a little fancier. If anybody needs to know how I did any of it, just ask.

    Star Wars Quotes: http://stengazette.org/wordpress/swqotd/
    and
    Bushisms: http://stengazette.org/wordpress/gwbqotd/

    TKS SG

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.