How To Get Posts With A Specific Word

How to retrieve posts with a specific word in the loop. For example, I want to retrieve all posts with the title of the profile post (custom post type): http://www.wwefansnation.com/wrestler/dolph-ziggler/

I created profiles in my website, and I want to display all the posts which contains the word “Dolph Ziggler” or the name of the profile.

Related posts

Leave a Reply

1 comment

  1. What you’ve described is just a search for the words “Dolph Ziggler”.

    You can use WP_Query as such

    $query = new WP_Query( ‘s=keyword’ );

    Note, that you’ll probably want to cache those queries as they’ll be very slow.