0

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

Thanks

My search.php

<?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() ) {
            $the_query->the_post();
        }
    }
?>

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.