• Hi,

    It sound weird, but is it possible to give a specified word a color?

    So if i add the word “Announcement” to the post title, it will be the color blue. And the other words in the post title will be black or something.

Viewing 10 replies - 16 through 25 (of 25 total)
  • Ayman

    (@aymanalzarrad)

    If you can give me the link to the page containing the word so I can have a look.

    Thread Starter Matthijs

    (@matthijs110)

    https://www.rvec-dev.tk/announcement/

    And on the home-page.

    I replaced blue with red. Cause the default home-page color is blue.

    On style.css and Functions.php

    Ayman

    (@aymanalzarrad)

    Strange, but it doesn’t look that the code is there.7
    Please, Make sure that you are inserting the word as you already typed it in the title EX:

    When adding new post you are typing in the title field of the post:
    Boo
    Than in the code you have to insert Boo NOT( boo or BOO or bOO ) it has to be exact case. So the first letter has to capitalized.

    Thread Starter Matthijs

    (@matthijs110)

    I did, its still not working :/

    Ayman

    (@aymanalzarrad)

    Try replacing this line:

    add_filter('the_title', 'word_color');

    With this:

    add_filter('the_title', 'word_color', 10, 2);

    Thread Starter Matthijs

    (@matthijs110)

    Still doesn’t work…

    Ayman

    (@aymanalzarrad)

    Man I’m lost… :-/
    its really strange, I already tested the code before giving it to you.
    I will have a look around and get back to you.

    Thread Starter Matthijs

    (@matthijs110)

    Okay.

    Wait, does it help if i tell what theme i am using?

    Ayman

    (@aymanalzarrad)

    I think that the filter is being hooked too late.
    Try this one instead of the one I gave you earlier:

    add_filter('the_title', 'word_color', 1);

    Thread Starter Matthijs

    (@matthijs110)

    Still…

    Btw, i am using the Responsive theme. Of Cyberchimps. I don’t know if that helps.

Viewing 10 replies - 16 through 25 (of 25 total)
  • The topic ‘Word specified colors’ is closed to new replies.