• Hi,
    i need help with simple condition:
    if TITLE contain word1, show content1

    Thanks

    • This topic was modified 9 years, 5 months ago by mirecl.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Please explain that a bit more. What are you trying to accomplish?

    Thread Starter mirecl

    (@mirecl)

    If is in TITLE of single post 1word, in the body of single post is showing specific content.

    Explain with car:
    Title of single post is: Toyota Corolla(Car)
    Content of single post is: standard content + specific content for cars

    Explain with motorcycle:
    Title of single epost is: Yamaha FZ(Motorcycle)
    Content of single post is: standard content

    Is it already obvious?
    Thanks

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    You could do this with a filter on the_content

    https://codex.ww.wp.xz.cn/Plugin_API/Filter_Reference/the_content

    In your filter, test for words in the post/page title and add appropriate text to the existing content (or modify it as necessary).

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘If TITLE contain word1, show content1’ is closed to new replies.