getting posts by tags


i use below code for getting posts by word tag

$search_songs = array(
        'posts_per_page' => -1,
        'post_type' => 'songs',
        'tax_query' => array (
            array (
                'taxonomy' => 'post_tag',
                'field'    => 'slug',
                'terms'    => $search_query,

    $new_query = new WP_Query( $search_songs );
    $search_songs_posts = $new_query->posts;╨

But by this code it return posts that have exactly word tag

when search “akam” it return posts that have “akam” tag ,
BUT when search “aka” (a part of word) it return nothings
i want to when search “aka” it return all post that have tags that include my arg(“aka”) not just exactly word


ebeliejinfren 2 months 0 Answers 7 views 0

Leave an answer