Join WhatsApp ChannelJoin Now

How To Search By post_type In WordPress

Hi Dev,

Today, i we will show you how to search by post_type in wordpress. This article will give you simple example of how to search by post_type in worpress. you will how to search by post_type in wordpress. In this article, we will implement a how to search by post_type in wordpress.

So let’s follow few step to create example of how to search by post_type in wordpress.

Example

<form role="search" action="<?php echo site_url('/'); ?>" method="get" id="searchform">
    <h3 style="color: #333;text-align: center;">Search Loan Id</h3>
    <input type="text" name="s" placeholder="Search Loan Id" style="margin: 0 0 20px;"/>
    <input type="hidden" name="post_type" value="loanpost" /> <!-- // hidden 'products' value -->
    <input type="submit" alt="Search" value="Search" />
</form>

I hope it will assist you…

Recommended Posts