Tell us what you are trying to do?
I am trying to replicate the search functionality from this archive page: hidden link (password: health) to be on the homepage hidden link with results showing up on that same directory page, then the user can reset the search and start again. For now I set up this test page to demonstrate the functionality I want: hidden link
The results for the state is working, but not the EHR or PHM systems.
I created a view for the search but that may not be the right way to do it.
Hi thank you for responding. It's actually the results that aren't returning the correct values (or any values for EHR and PHM). When I search for Alaska on the old and new searches, I get the correct HCCN (the main custom post type we're querying) and the PHC Location is correct for both. However, the "old" search hidden link (password: health) returns some results for the EHR and PHM, but the "new" search says "No EHR Listed" and "No PHM Listed" hidden link
I attached screenshots of the results for each. One thing I noticed is that in the old archive page, we were able to query by both Post and taxonomy (States Served) but I may be missing that piece on the new view.
During troubleshooting, I noticed that in the view "Home Search" used on the homepage, the loop is loading the content template "Loop item in HCCN Directory" from the archive "HCCN Directory".
The relationship query filter in the views "EHRs list for HCCN" and "PHM list for HCCN Directory" doesn't work with the option "The post where this View is shown" because they are not placed in the content template of the view "Home Search".
To make this work, I added the following changes:
1. In the content template "Loop item in HCCN Directory" I passed the current HCCN post's ID in the shortcode for the views "EHRs list for HCCN" and "PHM list for HCCN Directory", through the attribute wpvrelatedto="[wpv-post-id]".
( screenshot: hidden link )
2. Next, in the relationship query filter for views "EHRs list for HCCN" and "PHM list for HCCN Directory", I changed the option "The post where this View is shown" to "The post with ID set by the shortcode attribute wpvrelatedto".
( screenshot: hidden link )
As a result, the "EHR" and "PHM" values are now showing correctly in the search results from the homepage's view too.
I hope this helps and please let me know if you need any further assistance around this.