[Resolved] Search Box in the header

Home Forums Support [Resolved] Search Box in the header

Home Forums Support Search Box in the header

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1253061
    Ram

    Hello,

    I would like to show the search bar in the highlighted area. PFA screenshot

    Thanks

    https://snipboard.io/dPC3Nh.jpg

    #1253293
    David
    Staff
    Customer Support

    Hi there,

    if you want to use the Default WP Search field then add this PHP Snippet to your site:

    add_shortcode( 'search_form', function() {
        ob_start();
    
        get_search_form();
    
        return ob_get_clean();
    } );

    Adding PHP: https://docs.generatepress.com/article/adding-php/

    You can now add this shortcode [search_form] to your Header Element

    #2421976
    Rafael

    Hello David:

    REgarding to this topic……….

    Is it possible that in the shortcode I limit the search by category??

    Apreciate your help about..

    Rafael

    #2422010
    Leo
    Staff
    Customer Support

    That’s the default search form from WP core so you would need to check with WP’s support team.

    #2422021
    Rafael

    Thanks…..

    #2423323
    Leo
    Staff
    Customer Support

    No problem 🙂

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.