• I want some content to be displayed only in posts that has certain words as part of the title (I dont want to list all post titles in is_single). How can I do that?

    Thanks ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • You’ll probably have to build a custom select query and check for posts WHERE post_tittle LIKE ‘%$the_word_you_are_looking_for%’. Keep in mind that the LIKE operator can get a bit slow on big databases, though.

    Thread Starter tyggis

    (@tyggis)

    Thanks julia. How would that code look like? You see I am not a coder ??

    The keyword is melk, I need all the posts with the work melk in the title to show some spesific content.

    This is what I am using now, but there are to many posts to list all in the is_single array:

    <?php if (is_single(array(‘melk’, ‘Kokosmelk’ , ‘Kokosmelk med gre’))) { ?>
    Some content
    <?php } else { ?>
    Other content
    <?php } ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Display content only in posts that has specified words in title’ is closed to new replies.