Search work for only blog post data?

Answered

Search work for only blog post data

Trainee Asked on March 4, 2017 in WORDPRESS.
Add Comment
1 Answer(s)
    Best answer
    
    <div>
    
    <form class="search" method="get" action="<?php echo home_url(); ?>" role="search">
    
    <input type="search" class="search-field" placeholder="<?php echo esc_attr_x( 'Search …', 'placeholder' ) ?>" value="<?php echo get_search_query() ?>" name="s" title="<?php echo esc_attr_x( 'Search for:', 'label' ) ?>" />
    
    <input type="submit" value="Search" />
    
    <input type="hidden" name="post_type" value="post" />
    
    </form>
    
    </div>
    
    Team Leader Answered on March 6, 2017.
    Add Comment

    Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.