Forums › Forums › Search & Filter Pro › ACF posts not displaying
- This topic has 5 replies, 2 voices, and was last updated 5 years, 3 months ago by
Trevor.
-
Trevor(Private) May 27, 2020 at 9:09 am #246000
Are you able to send me a live link/URL to your search page so I can take a look?
In selecting the Meta Key name, note a ‘gotcha’ with ACF ….
… it makes 3 meta keys per field, like this (in this example for a field named ‘land’):
#1
_land
#2field_52f0fc4334f52
#3land
In our Meta Key selection list, you need to use key #3, without the underscore at the start of the key name. If you choose #1 by mistake, in the field choices you will see the name of #2.
Anonymous(Private) May 27, 2020 at 1:09 pm #246091Hi, Trevor thank you for your reply. Ah. I did not see that.
I have changed the filter to the non-underscore option and its still not showing. Looking at the page source, the loop fails to load and everything below it is just blank in the source code.
The site is only working locally at the moment so unable to share a link.
Is there a way of using the non-custom page template and just the standard loop with ACF content?
Lee
Trevor(Private) May 28, 2020 at 12:41 pm #246296If you want ACF fields to display in the results, you will need to code it. I cannot see any obvious errors in your code, but you need to follow standard debugging methods to find where it is failing. One thing I see that you are not doing is to test for the existence of the variable before using it.
The method I would use is to reduce the code to a much smaller amount, thus not outputting a lot, test it, add a bit in, test it, and so on.
It will not be our plugin causing this though, it will be your code.
-
AuthorPosts