WordPress.org

Ready to get started?Download WordPress

Forums

Automatic Text Replacement (5 posts)

  1. lowlight
    Member
    Posted 5 years ago #

    I would like to have certain words in my blog to be linked to glossary pages I will be adding, and in some cases I want some text to be replaced by images I will be using a lot. Rather than go through and manually add all these links, is there a plugin that will do it for me? Something that will spider my content, and find the words I add, with links defined manually?

  2. krembo99
    Member
    Posted 5 years ago #

    This plugin replaces words with anythigs (as the author say)

    http://www.biggnuts.com/link-a-dink/

    So maybe you can use it to display images as well..
    Never tried it , and do not know how the HTML will be parsed.
    But at any rate, it is a simple function to write , to be added to your functions.php (only less flexible than the plug)

  3. krembo99
    Member
    Posted 5 years ago #

    <?php
    
    /*
    Plugin Name: Replace word with image
    */
    
    function replace ($text) {
    $text = str_replace('word', '
    <img src="next.jpg" /> ETC.ETC....
    ', $text);
    return $text;
    }
    
    add_filter('the_content', 'replace'); ?>

    this is the basic plugin/function,
    Now if you want it to be flexible with an interface, some DB integration is needed, but if you only have 2-3 words, you can use simple functions.
    Nice idea for someone to develop though.

  4. lowlight
    Member
    Posted 5 years ago #

    I would definitely be adding a lot of words... For instance a deck of cards would have 52 entries in itself.. I just want to be able to say, write :Qh: and it will replace it with an image tag for the queen of hearts.

    If someone knows of a plugin, let me know!

  5. lowlight
    Member
    Posted 5 years ago #

    Well I just figured it out - just use smilies! There is a plugin that allows custom smiley management, so I am just using that.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.