Reputation: 3517
I am writing a wordpress plugin and I want to hide posts/pages which contain a specific string in their title.
For example, I want to hide all the posts/pages where the title contains: [something123]
show this post/page "Lorem Ipsum"
hide this post/page "Lorem Ipsum [something123]"
hide this post/page "Hello World [something123]"
show this post/page "Hello World"
Upvotes: 0
Views: 846
Reputation: 39872
In your theme directory find loop.php
In it there should be a line like this
<?php while ( have_posts() ) : the_post(); ?>
pseudocode:
if (get_the_title() contains "") { endwhile; }
http://codex.wordpress.org/Function_Reference/get_the_title
You could also use a filter:
http://codex.wordpress.org/Plugin_API/Filter_Reference/posts_where
Although I don't feel like writing one for you =). Maybe somebody else will.
Upvotes: 1