Support » Themes and Templates » Multisite: can I use get_current_blog_id(); in searchform.php

  • I have a multisite installation and need to use the current blog id to set values in searchform.php

    I’ve used get_current_blog_id(); in page templates successfully, but when I try to use it in searchform.php, it does not return any value.

    http://www.finditindenver.com/coupons

    In the header, the search form should display Denver in the 2nd field, as it does in the body of the page.

    Any ideas what I’m missing? I thought that it was a global variable.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Ayman

    (@aymanalzarrad)

    Where your search form is being called? is it header.php?

    It is actually being called in functions.php in my child theme.

    /** Add search form to the header **/
    add_action('travelify_header','header_search');
    function header_search()
    {
    	get_search_form();
    }

    On the home page, I call another instance of it over the slider graphic

    /** Add search form to the featured search **/
    function featured_search()
    {
    	get_search_form();
    }
    add_action('travelify_main_container','featured_search',20);

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Multisite: can I use get_current_blog_id(); in searchform.php’ is closed to new replies.