Link to a page where the issue can be seen: hidden link
I expected to see: information about "Weller Garden" which is located in New York State.
Instead, I got: information about "George Sweller Daylily Display Garden" in Moscow, ID. You can see that every detail aside from the title of the page is identical between the two: hidden link and hidden link
The shortcode that I'm using for the Weller garden is: [wpv-view name="single-display-garden-info" searchname="Weller Garden"]
The shortcode that I'm using for the George Sweller garden is: [wpv-view name="single-display-garden-info" searchname="George Sweller Daylily Display Garden"]
This is the first time that I've encountered a problem, because all of my other entries are apparently more unique. In case it helps, the George Sweller entry was created a while ago, and the Weller Garden entry was only added in the last couple of weeks.
To me, it seems like the text filter is doing a fuzzy search and finding the closest match instead of doing an exact match. Does that sound close to how it's designed? I'm definitely looking for a more direct match.
You may require to adjust the filter code I shared as per your requirement. If you do not know how to do it, please send me problem URL and access details, I would be happy to adjust it on your behalf.
I have set the next reply to private which means only you and I have access to it.
Thank you for your help so far. You are correct - I'm trying to do an exact match on the string instead of an approximate or fuzzy match.
I have copied and pasted the code into the Functions.php file for my current theme, and I changed the view ID to match the one that I'm trying to adjust. However, this hasn't corrected the issue.
Can you please share problem URL where I can see the search form as well as access details so I can see whats going wrong there.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
- As I understand, you want to filter the view results with your post title. You can even filter with post ID.
Rather editing every post, why dont you either create content template or Layout and assign that content template or layout to display with the post type "Display Gardens". The benefit of this will be you will not be require to edit the each post.
Once you confirm what approach you would like to go with, I will address the exact search string issue after that. As if you want to filter the post with exact match (post title), then we can even filter with the post ID as well.
I'm still trying to sort through your last message. I believe I tried to use the content templates and layouts first, but my theme (which was custom built by someone other than me) did not show any of the details. The theme is a disaster...
I'm working on getting a copy of the site moved to a dedicated Development environment so that I can feel more confident in making this type of change.
I have copied my site to a new development environment. I attempted to create a new Layout for the content type Display Garden, and I applied it to all of the posts of that type. The problem that I have with my theme is that no matter what I put into the body of the layout, the only thing I get to display on the site is just the title of the post. Even if I assign static text to the layout, it does not get displayed by my site's theme.
When I created the content type "Display Garden", I used the existing single post template file (single.php) and made a copy of it called single-display-garden.php. I only changed a minor portion of the code within that file, and it was only to tie the theme files to the content type.
Here's the code in that PHP file:
<?php
class single_display_garden extends Core_Template {
public function post_data()
{
global $post;
return [
'title' => $post->post_title,
'content' => apply_filters('the_content', $post->post_content),
];
}
}
global $post;
new Single_Display_Garden($post->ID);
For whatever reason, the toolset layouts never get passed in as "the_content" no matter what I've tried.
Any ideas to overcome this obstacle so that we can get back to the original question? 🙂
That doesn't quite work. My theme file doesn't contain the while loop that is mentioned in the documentation. I've added it into the code where it seems to fit, but now the content is appearing above the title and behind the main menu/site hero, which is not useful.
I'm using Timber and Twigs for the theme on the site, if that helps. I've searched for ways to use the the_ddlayout() function within Timber/Twigs, but I haven't found anything helpful.
Ok, then back to the original problem: how do I get it to do an exact search instead of the fuzzy search without moving to a Toolset Layout for the content type?
No need to add that code to other field and the code I've added will only apply to view ID "9952" - so if you have other views those will not be get affected.
Glad to know that solution I shared help you to resolve your issue.