danzigism
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: best way to search for taxonomy termsI kind of have a similar issue except I’m trying to search for both keywords AND a user selected taxonomy term.
for example the search URL should look something like this:
https://mydomain.com/?movies=horror&s=spongebob
Which should produce *no results* since spongebob is not a Horror flick. The query simply disregards the tax term specified in this case the movie genre and just shows ALL results for Spongebob.
is there a special way to form these URLs when also including a specific tax term?
Forum: Fixing WordPress
In reply to: Search Form with Custom Taxonomy Dropdownrevised my search URL so that it just uses:
https://mydomain.com/?taxterm=TAXTERM&s=KEYWORD
this displays the right tax term, but the tax term gets overrided by the keyword.
Forum: Fixing WordPress
In reply to: Search Form with Custom Taxonomy Dropdownugh. so I thought I was done. However, this kind of search query does not work correctly.
When using a URL such as:
https://mydomain.com/?taxonomy=TAXONOMY&term=TAXTERM&s=KEYWORD
It simply ignores the term and just displays the complete list of results based on the KEYWORD.
Anybody know how to ensure that the results *only* display the items that are within that specific term?
Forum: Fixing WordPress
In reply to: Search Form with Custom Taxonomy DropdownGOT IT WORKING!
I specified the wrong name=”” attribute for the <select> tag. It needs to be formed like this:
<select name="taxonomy=TAXONOMY&term">
I was just using “s” which just does a basic keyword search without a taxonomy specification. This now completely appends to the search. Here’s the complete code for anyone who needs this kind of functionality.
[Code moderated as per the Forum Rules. Please use the pastebin]
Forum: Fixing WordPress
In reply to: Search Form with Custom Taxonomy DropdownAhh I’m getting close. I forgot to add the name=”s” attribute to the <select> tag. It is added but maybe I’m thinking about this the wrong way. Now it just simply uses the slug of the taxnomy term as a keyword.
The URL now looks like:
https://www.mydomain.com/?s=KEYWORD&s=MYTAXTERM
Perhaps I’m going about this the wrong way. How can I customize the query so that it specifically searches for keywords that match the selected taxonomy term?
I think the URL needs to formed as such:
https://www.mydomain.com/?taxonomy=TAXONOMY&term=TAXTERM&s=KEYWORD
Forum: Fixing WordPress
In reply to: Search Form with Custom Taxonomy DropdownI went ahead and added a value to the option selector in the function:
function get_terms_dropdown($taxonomies, $args){ $myterms = get_terms($taxonomies, $args); $output ="<select>"; foreach($myterms as $term){ $term_taxonomy=$term->Categories; $term_slug=$term->slug; $term_name =$term->name; $link = $term_slug; $output .="<option value='".$link."'>".$term_name."</option>"; } $output .="</select>"; return $output; }
Doesn’t seem to be appending anything to the query. Still only operates primarily when typing in a keyword in the text input.
Absolutely. I would love to see the added ability of having Custom Post Types. I currently made my own functions for searching through custom post types, but it is almost impossible to include both a text input query AND and taxonomy selection in the search.
great info. that works a treat. However I do still have some issues when searching for certain parts of my custom fields. For example some of my custom fields are:
Address: 123 Joe Blow Road
City: Georgetown
State: AL
Zip: 12345
Business Type: ComputersIf I search for “Joe Blow” the results display just fine. If I search for “Computers Georgetown” it works just fine.
But if I type “Computers 12345” for the ZIP code, it does not work. Nor does a query like “Computers Joe Blow”.
Any idea as to why certain keyword combinations don’t work? It’s all basic meta data inserted in to each custom post the same exact way.
Hey there, I too experience this same issue. I’m using a custom post type and lots of meta data. It works great for singular keywords, but as soon as I type in an obvious multiple-keyword query, it produces no results. Thanks for anyone who can help figure out this issue.
Anybody come across a solution to this problem? I am also using a custom post type with all sorts of meta data. I need to be able to perform multiple keyword queries but it definitely doesn’t work.
Any help would be awesome.