Searching With Apostrophe

Your question isn’t much of a WordPress related question, more like a MySQL question. But I have sort of a solution in my head: You could go with a custom query and a replace on the apostrophe: SELECT * FROM `table` WHERE REPLACE( `column`, “‘”, “”) LIKE REPLACE( ‘string’, “‘”, “” ) For a combined … Read more

Using search.php without a ‘s’ field in searchform.php

I am not sure as how to get around using id=”s” in the input field. But just to clarify, I believe wordpress is doing something like $input = $_POST[“s”]; when the search is submitted. The id=”s” is necessary because it tells the php script from which html input field to pull the input from. WordPress … Read more

Search in Archive Pages by subcategory, tag, custom field and year

You only need one form and a callback on pre_get_posts. For example: <form role=”search” method=”get” id=”searchform” action=”<?php echo $current_url; ?>”> <input type=”hidden” name=”s” value=”true” /> <!– Tag Search –> <label for=”tags”>Search Tag:</label> <input type=”text” value=”Search” name=”tags” id=”tagsearchbox” /> <!– Custom Field “autor” Search –> <label for=”autors”>Search in Custom Field ‘autor’:</label> <input type=”text” value=”Search” name=”autors” id=”autorsearchbox” … Read more