• If I have a website that frequently mentions a product with a specific name like

    acmeProduct

    Is there a way to program my wordpress site to ALWAYS italicize the word “acme” and ALWAYS capitalize the “P” in product?

    With multiple blog contributors, I feel like it would be easier to do this sitewide instead of swatting flies.

    Would I have to develop a plugin or is this possible to do with CSS?

Viewing 1 replies (of 1 total)
  • Hi @withacause,

    I found a function online which appears similar to what you are looking for and tested it by creating two span classes instead of the single span from their example.

    Then I played around with CSS for the two classes. You can test it, too if you want.

    function replace_content($content) {
    $content = str_replace('acmeproduct', 
               '<span class="acme-style">acme</span>
                <span class="product-style">product</span>'
               ,$content);
    return $content;
    }
    add_filter('the_content','replace_content');
    span.acme-style {
       display: inline;
       font-style: italic;
       text-transform: lowercase;
    }
    span.product-style {
       display: inline;
       font-style: normal;
       text-transform: capitalize;
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Make a certain word appear in italics with capital letters across whole site’ is closed to new replies.