title: How To Call get_search_query(); In Wordpress functions.php File?
body: <p>I want to call search keyword in functions.php file and use it in an array but it is not being called. </p>
  
  <p>It is called easily in search.php file and I am able to show it on search results page using </p>
  
  <pre><code>&lt;?php $search_query = get_search_query(); ?&gt;
  &lt;div align="center"&gt;
  &lt;h2&gt;Search Results For "&lt;?php echo $search_query ?&gt;"&lt;/h2&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>How to call <code>$search_query</code> or<code>get_search_query();</code> in functions.php file ?</p>