headerIMG

B2B Articles - January 25, 2014

Search specific categories in Wordpress

Wordpress web designDid you know that you can build mini, focused search engines for Wordpress that search specific categories?

You can transform sections of your website into individual blogs or topical sections. For websites with both breadth and depth of content, building a search function for specific categories could be great for user-experience. This can be a very handy web design practice for content websites, resource websites or larger blogs.

For example, below is a search request for the word "wordpress" within the "articles" category.

https://example.com/category/articles/?s=wordpress

By limiting search to specific categories, users will be able to mine sections of your website for more specific topics and resources. It will be important to indicate that the search function implemented is category specific.

How to develop a category select search form

<form method="get" action="<?php bloginfo('url'); ?>">
<fieldset>
<input placeholder="search category" type="text" name="s" value="" maxlength="50" required="required" />
<select name="category_name">
<option value="industrynews">Industry News</option>
<option value="webdesign">Web Design</option>
</select>
<button type="submit">Search</button>
</fieldset>
</form>

Before installing a pre-made plugin, try the above form to create a simple search function for your website. Embed the code in the sidebar.php file inside your active theme, and change the category options to your actual category names and IDs. Certainly, you could dynamically pull the list of categories for websites and blogs with a larger set of categories. But the above method is fine for websites with a few categories that are more permanent.

Custom query variables using GET for Wordpress

Public query vars allow you to develop direct URL queries.  example.com/?variable1=value1&variable2=value2 - You can also create custom query vars that you append to URLs (eg: "https://mysite.com/some_page/?s=my_var=foo"

Wordpress makes it easy for web designers to build tools and custom the user-experience.

 

Tel 212-993-7809  

Ironpaper ®
10 East 33rd Street 
6th Floor
New York, NY 10016
Map

Ironpaper - B2B Agency

B2B Marketing and Growth Agency.

Grow your B2B business boldly. Ironpaper is a B2B marketing agency. We build growth engines for marketing and sales success. We drive demand generation campaigns, ABM programs, B2B content, sales enablement, qualified leads, and B2B marketing efforts. 

Ironpaper Twitter Ironpaper Linkedin