最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

pulling in external JSON search results into WordPress

programmeradmin1浏览0评论

I want to retrieve search results from a search appliance that gives results in JSON format. Interacting with the form below takes the user to a page of JSON data. Instead, I want to take the search.json content, parse it, and display the results on our WordPress site.

<form method="get" action="/s/search.json">
    <input type="hidden" name="collection" value="our-stuff">
    <input class="search-input" value="<?php echo get_search_query(); ?>" />
</form> 

I tried editing the action parameter to include the wp_remote_get function like so action=<?php wp_remote_get("/s/search.json";?> but I get a php parsing error.

发布评论

评论列表(0)

  1. 暂无评论