• Hello, WordPress newbie here, working on my first site (not ready to reveal it). Is there a way to automatically-bold the words “SET ONE:” and “SET TWO:” every time it appears in any post? To put the ‘strong’ tags around the phrase SET ONE anytime it appears?

    I have:
    WordPress 1.5.1.3
    Modified Kubrick template

    I’ve searched, and my ideas so far would be to use a Plugin, I haven’t tried, perhaps InScript Plugin https://www.urbangiraffe.com/plugins/inscript which sounds like it does anything (?) or perhaps a Smilies plugin if it would replace every time I type “SET ONE:” with a small button-graphic I’d designate. I might be way off-base. If this can be done automatically with CSS or another way, please suggest.

Viewing 13 replies - 1 through 13 (of 13 total)
  • Might the Text Switcher plugin do what you’re looking for? You could set the trigger text to “SET ONE:” and set the replacement text to <strong>SET ONE:<\strong> – that should do it perhaps?

    Thread Starter Dgold

    (@dgold)

    Etoile, thanks, that seemed to be what I want. I have half-a-problem using it.

    Can you help me make this work for all my posts? I’ve installed and activated the Text-Replace plug-in, and I’ve modified the $text_to_replace array as I wish. My goal is simply to bold every appearance of the phrases SET ONE:, SET TWO:, and ENCORE:. Strangely, it has inconsistent behavior. It works on some of my posts, but not others. Is there a date-setting or post-time-sensitive rule? It appears to be working on new/future posts, but not working on old posts I back-dated with WordPress “Edit Timestamp”. Or, possibly, it is failing to work on posts which I have Edited since publishing.

    To trouble-shoot, I tried Deactiving and re- Activating the plug-in. I modified the php-file to try different things in my text-replace array. I was concerned that having a space between the words SET ONE, and SET TWO, was the problem. I do not want these phrases to require a leading-: because they are already written.

    If I am able to post code correctly, this will show how I’m trying to apply the strong tag to SET ONE, SET TWO, and ENCORE using Text-Replace:

    $text_to_replace = array(
    ":wp:" => "<a href='https://www.remarpro.com'>WordPress</a>",
    "SET ONE:" => "<strong>SET ONE:</strong></a>",
    "SET TWO" => "<strong'>SET TWO:</strong>",
    "ENCORE:" => "<strong>ENCORE:</strong>",
    );

    Thread Starter Dgold

    (@dgold)

    I guess I can show you where it’s not working (just a test version mostly default theme).

    Odds are, the plugin is case sensetive, and thus if you don’t use the same capitalization each time it won’t be replaced.

    Thread Starter Dgold

    (@dgold)

    Good thought, but I don’t think so. There’s a line,
    function c2c_text_replace( $text, $case_sensitive=false )
    and I’ve tried it with case_sensitive true and false.

    Plus, I’m always typing it in All-Caps anyway.

    Thread Starter Dgold

    (@dgold)

    I’m still looking for help with this plugin. I must have the text-replace array rule written wrong for “SET ONE:” and “SET TWO:”. I just want to surround those phrases with STRONG tags, every time you see the exact phrase SET ONE:.

    Any ideas?

    Have you tried contacting the plugin author about this? That’s usually a good place to start….

    Thread Starter Dgold

    (@dgold)

    Yes, I posted my question there also https://www.coffee2code.com/archives/2004/06/29/plugin-text-replace/

    Hoping Etoile might return here with some experience

    Do I need to put a code for the space in the phrase?

    Thread Starter Dgold

    (@dgold)

    Shucks. Hate to BUMP, but I’ve posted my question on the Plugin Author’s site, and still have no answer (2 weeks passed).

    I found some minor errors in my text-replace array, but I’ve fixed everything I see wrong. It still inconsistently recognizes “SET TWO:” and when it does, it only bolds the word TWO: not the word SET.

    I’m guessing: there’s a problem with using a blank space in the text-replace array? Anyone know another code for a blank space, the way you can use a code for Ampersand or other symbols?

    It’s not recognizing a simple underline, as in SET_TWO? Okay, well the UTF-8 code for underline seems to be “–” – try that…. Hmmm. Nope, that’s not it, let me check s’more…. okay, maybe “_”….

    AUAGUUGHH! Even backticks don’t work…. *sigh* Try using “& # 95 ;” – take out the extra spaces and don’t use the quotes.

    And here’s a handy table: https://www.tony-franks.co.uk/UTF-8.htm

    Thread Starter Dgold

    (@dgold)

    Thank you for the table. But it’s not an underline. It’s a plain old blank space.

    Well, I’m not sure you can have a blank space. I think you have to replace blank spaces with the underline character…. I could be wrong, I frequently am, if I am someone else will come along and correct me….

    Thread Starter Dgold

    (@dgold)

    Shucks. I just can’t seem to get TEXT REPLACE to work consistently for me. The thing that seems odd, it works on some of my posts, some of my terms; but not other posts even with the same term.

    I’ve tried re-writing my terms without the Blank Space. For example, I made the text replace array

    "TWO:" => "<strong>TWO:</strong>",

    The test version is on https://dj.dgold.info/

    Anyone help?

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘How to auto-bold a word every time it’s in a post’ is closed to new replies.