<h2>Search results for: <?php the_search_query(); ?></h2>
in my code so that the relevant search terms are displayed but nothing happens. I’ve created a search.php file and copied my index.php code into it. I’ve reviewed the WordPress documentation and I’ve even downloaded the tutorial’s code and copied and pasted it into my file with no success. Please advise.
]]>Could you let us know how to modify “the_search_query()” output format?
We use below and output message if there is no search result in Japanese.
We have included “wp-custom-fields-search-ja.mo” for Japanese localization under /wp-content/plugins/wp-custom-fields-search.
However, that “the_search_query()” returns wrong message (it include unwanted character). So we want to remove it.
===========================
search.php
…
<p class=”title”>『<?php the_search_query(); ?>』の検索結果</p>
…
===========================
Thanks in advance.
Regards
Tyd
https://www.ads-software.com/plugins/wp-custom-fields-search/
]]>I have google custom search implemented on my blog in a 2-page format, it works OK.
i’m trying to add the number of posts found, and also the search query from the user to be displayed above my search results, i have tried the following php but it seems to only show ’74’ results for EVERY search, and the search query itself does not display between the “” speech marks, my search template:
<?php
/*
Template Name: Search Results
*/
?>
<?php
/**
* @package WordPress
* @subpackage Default_Theme
*/
get_header(); ?>
<div id="content-page">
<h2>Your Google Search Results</h2>
<?php
$mySearch =& new WP_Query("s=$s & showposts=-1");
$num = $mySearch->post_count;
echo $num.' useful search results for "'; the_search_query();
?>
<!-- Place this tag where you want the search results to render -->
<gcse:searchresults-only></gcse:searchresults-only>
<!-- Search Results code above this line -->
</div>
<?php
include
(
"sidebar2.php"
)
; ?>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
i have also tried:
<?php the_search_query(); ?>
and
<?php echo 'Search Results for "'; the_search_query(); echo '"'; ?>
before my search results, but it doesn’t seem to pull the search query in.
i’m stumped, any gcse experts in the house?
my blog: https://artbyherbie.com
This link is a good example.
How do I remove these slashes that are added?
]]>Is it possible to link to an empty search page?
I’m using the nice-search plugin (https://txfx.net/code/wordpress/nice-search/), so that something like say myblog/search/the gives me a results page as you would expect.
But loading myblog/search/ on it’s own gives me a blank page from the_title downwards.
I had the same problem before I tried the nice-search plugin so I know it’s not related to that…
Surely there is way to link to an empty search page? (I’ve got a /search link in my navbar, hence the question)
Thanks!
]]>$SearchQuery = the_search_query();
Questions:
– Is there a function for search similar to what the_title(false) or get_the_title allow?
https://wiki.www.ads-software.com/?pagename=get_the_title
– does the_search_query() work only inside the Loop?
Any help appreciated, thanks. I have searched the codex, this forum, and Google, and found very little information about the WordPress search engine.
While I’m at it, suggestions to improve the documentation:
– put something at https://codex.www.ads-software.com/Search
– add a search section in https://codex.www.ads-software.com/Template_Tags
]]>