The MU forums have moved to WordPress.org

Blog Specific Search Box (3 posts)

  1. ciaravino
    Member
    Posted 13 years ago #

    Hello. I'm making a site that reviews products and I want a separate blog for each specific type, so there will be 3 different blogs. I also want a portal that has the 5 latest posts from each blog AND a search box that is able to search each blog separately, but from the portal page. I think I know how to get the latest posts from each blog and post them on the portal page, but I'm not sure about the search boxes. I would need 3, and each would search it's own blog.

    Thanks!

  2. dsader
    Member
    Posted 13 years ago #

    Add a searchform.php to your main portal theme with as many searchforms with urls and ids pointing to your blogs. And then use the default search widget in a sidebar. Here's a start...

    <form method="get" id="searchform" action="http://panda.myblogs.tld/">
    <div><input type="text" value="<?php echo wp_specialchars($s, 1); ?>" name="s" id="s" />
    <input type="submit" id="searchsubmit" value="Panda" />
    </div>
    </form>
    
    <form method="get" id="searchform" action="http://eats.myblogs.tld/">
    <div><input type="text" value="<?php echo wp_specialchars($s, 1); ?>" name="s" id="s" />
    <input type="submit" id="searchsubmit" value="Eats" />
    </div>
    </form>
    
    <form method="get" id="searchform" action="http://shoots.myblogs.tld/">
    <div><input type="text" value="<?php echo wp_specialchars($s, 1); ?>" name="s" id="s" />
    <input type="submit" id="searchsubmit" value="Shoots" />
    </div>
    </form>
    
    <form method="get" id="searchform" action="http://leaves.myblogs.tld/">
    <div><input type="text" value="<?php echo wp_specialchars($s, 1); ?>" name="s" id="s" />
    <input type="submit" id="searchsubmit" value="And Leaves" />
    </div>
    </form>
  3. ciaravino
    Member
    Posted 13 years ago #

    Thanks, it worked.

About this Topic

  • Started 13 years ago by ciaravino
  • Latest reply from ciaravino