WordPress add custom search

Question

I create template customsearch.php, adding this for page example.comsearch.html (ID page: 18)

    <?php
    /*
    Template Name: CustomSearch
    */
    
    get_header(); ?>
    
    <div id="primary">
            <div id="content">
        
    <script async src="https://cse.google.com/cse.js?cx=000000000000000000000:uiyuiyiyiuyui"></script>
    <div class="gcse-search"></div>
</div>
</div>
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

How to this page adding for example.com?q=xxxxxx

Result:

example.com/?s=xxxxxx - default search wordpress

example.com/?q=xxxxxx - google custom search

Sorry for my English

P.S.

I want to keep a default search

0
, UserUser-name 1 year 2020-07-15T06:10:25-05:00 0 Answers 59 views 0

Leave an answer

Browse
Browse