The MU forums have moved to WordPress.org

search.php (6 posts)

  1. SteveAtty
    Member
    Posted 14 years ago #

    If a theme doesn't have a search.php file which file does it fall back on to display the search results. Is it page.php?

  2. kgraeme
    Member
    Posted 14 years ago #

  3. SteveAtty
    Member
    Posted 14 years ago #

    Ok thanks for that.

    Second question:

    Is there any performance impact on changing :

    while (have_posts()) { the_post();

    to

    while (have_posts()) { the_post(); switch_to_blog($post->blog_id);

    with the corresponding endwhile modified with restore_current_blog

    in the index.php file?

    I'm working on integrating wpsearchmu into a whole number of templates and some don't have search.php files

  4. kgraeme
    Member
    Posted 14 years ago #

    Not sure. Maybe try outputting this in your footer.

    <!-- <?php echo get_num_queries(); ?> queries. <?php timer_stop(1); ?> seconds. -->

    It's commented just so that if your site is public you will only see it by doing a view source.

  5. SteveAtty
    Member
    Posted 14 years ago #

    Hmm

    Without the switching:

    <!-- 111 queries. 2.194 seconds. -->

    with the switching:

    <!-- 111 queries. 2.061 seconds. -->

    So it makes no real difference at all

  6. kgraeme
    Member
    Posted 14 years ago #

    That was my guess, but real numbers are better than guessing.

About this Topic

  • Started 14 years ago by SteveAtty
  • Latest reply from kgraeme