I have put some simple text fields in the header.php (the user can change the displayed telephone number and specify the URL of a button in the header). The values can be filled using an options page I made for the user.
Works fine, except on search.php search results. Whatever I do, the values are not displayed at all. I’ve disabled all plugins except ACF Pro, still no luck. Any ideas?
TO BE CLEAR: I am not talking about getting ACF’s to show up in search result, I am talking about ACF’s in header.php, that for some reason do not show up when viewing a search results page.
Looking at your code and the fact that the values are on an options page, I see no reason that this code should not be executed and show the values on the search result page. The only reason I can come up with is that is code is not loaded in the header for the search results page.
Do you have a “search.php” template in your theme? Does this template load the file that contains your code in the header?