Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi Pal,

    Use given code to search the category name

    $args = array(
    	'post_type' => 'post',
    	'tax_query' => array(
    		array(
    			'taxonomy' => 'category',
    			'field'    => 'slug',
    			'terms'    => 'politics',
    		),
    	),
    );
    $query = new WP_Query( $args );
    Thread Starter pal8

    (@pal8)

    Hi Nisha,

    Thanks but that I know. I need to get the query string parameter /category/… or ?category=…

    A side note. I have a custom front-page as root with latest posts. The list of all post is in index.php but I have to use /?s= in order for that page to load. How do I go to index.php without that? Or should I make a custom page?

    Thread Starter pal8

    (@pal8)

    Sorry nothing personal but this is wp in a nutshell. Complex, though when you know how to do it easy, poor explanation with overload of info when searching and bad support.

    I’m sure there is a good explanation for this issue, and building a theme, out there somewhere. Suggestions?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom search based on category with pagination?’ is closed to new replies.