• Resolved akuzma

    (@akuzma)


    Hello there,

    I want to use this plugin to style specific words with CSS. For example, I let it replace ‘word’ with ‘<span style=”color:red !important”>word</span>’.

    The Problem is: The plugin replaces the word in the header too, so if the page contains the word the title, it produces forbidden tag within <title></title> and other meta tags.

    Is there a possibility to fix this problem?

    Best regards,
    Andreas

    • This topic was modified 7 years, 2 months ago by akuzma.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Marios Alexandrou

    (@marios-alexandrou)

    Expand the Find portion to limit what is matched. For example, ensure that there is a certain HTML tag included in the matching portion so that only the occurrence you want to replace is replaced. Chances are you’ll need to use the RegEx option so you can do advanced matching.

    Thread Starter akuzma

    (@akuzma)

    Thanks for your answer, unfortenately it doesn’t help.

    Example: If I want to apply CSS to a special character (i.e. colorize all exclamation marks red) without using client-side JavaScript, I would use your plugin to search all ‘!’ and replace it with ‘<span class=”red”>!</span>’ but this will happen also to the head and produces an error, if the <title> contains an ‘!’.

    Maybe you have a better idea to realize something like that?

    Plugin Author Marios Alexandrou

    (@marios-alexandrou)

    You’d probably be better off looking into how to modify the output of the the_content function in your theme.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Replace only in document body’ is closed to new replies.