Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7738341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:14:22+00:00 2026-06-01T08:14:22+00:00

I have a custom search engine on a non-wordpress page. This search engine searches

  • 0

I have a custom search engine on a non-wordpress page. This search engine searches a database for a city (specified by a text input) and then returns the relevant information about that city and displays it on the page.

What I want to do now, is to below those results, display the results of a wordpress search of the same term on a blog that resides on the same server/domain. So basically I want to show the same results that a wordpress search of that keyword would return, but I want to display them on a non-wordpress page, not in the blog’s theme.

What I have:

a variable holding a search term, the search term has already been shampooed and conditioned to be search engine friendly.

What I don’t want to do

  • I don’t want to use an iframe and have the blog template be displayed on the page.
  • I can’t have a secondary search box. I need to somehow use the value of the variable that I have, I can’t ask the user to submit a second form or anything.

My ideas so far

Is there a way to run the wordpress search function and grab the data that it returns? I’ve gotten as far as including wp_blog_header.php on my static page so that I can make use of the wordpress functions.

Or would it be better to write a function that duplicates what the wordpress search does on the wordpress databases, but returns the data in a way that I can use?

Or is there a different approach that I should take for this that I’ve overlooked? Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T08:14:23+00:00Added an answer on June 1, 2026 at 8:14 am

    You must first include the WordPress files

    <?php define('WP_USE_THEMES', false);
    require('/server/path/to/your/wordpress/site/htdocs/blog/wp-blog-header.php');
    

    then use query_posts and the loop

    query_posts('s='.keyword);
    while (have_posts()): the_post(); ?>
        <h2><?php the_title(); ?></h2>
        <?php the_excerpt(); ?>
        <p><a href="<?php the_permalink(); ?>">Read more...</a></p><?php
    endwhile;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to add a custom search engine to Firefox. I have a name
I have been trying to create a new google custom search engine, but when
We were previously using a non-search engine friendly custom CMS for our case record
I have a Google Custom Search Engine on our site and I have recently
In the middle of attaching a Google Custom Search Engine onto my page, I
I have a specialized search engine that passes search criteria from the Search page
I have a custom ASPX search page for a CRM 4.0 solution I am
maybe some one can help me with this... I have a custom search button
I have a search program that has multiple input text boxes that correspond to
I have a webpage that is using Google's custom search engine. I wanted to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.