I have a created a custom post type say actor and created one actor "Tom Cruise" and URL is like /actors/tom-cruise in custom post type.
And I have created 3 posts (type is WordPress default post) slug is like /tom-cruise-mission-impossible1, /tom-cruise-mission-impossible2, /tom-cruise-mission-impossible3. Each slug is starting with tom-cruise pattern.
Now I want to display all 3 posts(similar posts in this case 3 mission impossible posts ) in custom post type (actors post) /actors/tom-cruise
I am trying to find similar posts but can't find from WordPress documentation with similar type of pattern used in slug. Any help appreciated. Please keep in mind don't want to create any additional category or is there any other way to do it without similar pattern slug query.
$args = array( 'post_type' => 'actors', 'post_status' => 'publish', ); $loop = new WP_Query( $args );