admin管理员组

文章数量:1122832

Wondering if there's a way to edit our search.php or .htaccess or function.php (or anything else...) so that our search function on our main site (www.oursite) includes the subdomain of blog.ourwebsite?

Any thoughts or suggestions are appreciated it..

Wondering if there's a way to edit our search.php or .htaccess or function.php (or anything else...) so that our search function on our main site (www.oursite.com) includes the subdomain of blog.ourwebsite.com?

Any thoughts or suggestions are appreciated it..

Share Improve this question asked Feb 1, 2013 at 21:34 E PE P 292 bronze badges 6
  • 2 Your search function would have to access WordPress's database, which certainly is possible, but I don't think I can give real answer without more information. – s_ha_dum Commented Feb 1, 2013 at 21:42
  • Thank you for your input - what sort of information would you need? I believe there are currently two wordpress databases set up (done by someone else) - one for the main site, one for the blog. I do have the database name/users/pw for both if needed? – E P Commented Feb 4, 2013 at 19:36
  • Are both sites WordPress? What does search.php look like? How good are you at SQL and PHP? – s_ha_dum Commented Feb 4, 2013 at 19:39
  • Yes - both sites are Wordpress. – E P Commented Feb 4, 2013 at 21:02
  • Please put code in your question, not as download/zip on an external resource. – kaiser Commented Feb 18, 2014 at 3:46
 |  Show 1 more comment

1 Answer 1

Reset to default 0

If you transform your main website's Wordpress into a multi-site environment, you can move blog.yourdomain.com to be a network site.

Once you do this, you could use the Multisite Global Search plugin to add a widget that searches all network sites.

It would be easy to move your standalone blog.yourwebsite.com to a network site:

  1. export the content from blog.yourdomain.com,
  2. create a subdomain Wordpress network on your main website,
  3. edit your blog.subdomain.com settings (Settings > General) to change the site and Wordpress URL to blog2.subdomain.com,
  4. rename your subdomain blog to blog2 in cPanel,
  5. create a network site called blog.yourdomain.com
  6. import the content you exported earlier.

Done.

PS - You'd need to copy any themes and plugins you have on blog2.yourdomain.com into the main Wordpress installation.

本文标签: Make Search Function include subdomain (blogourwebsitecom)