I want to show the categories in the search results. How do I do this without plugins?


My search.php

    $s = get_search_query();
    $args = array(
        's' =>$s
    $the_query = new WP_Query( $args );
    if( $the_query->have_posts() ) {  
        while( $the_query->have_posts() ) {

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.