• Resolved BarretD

    (@barretd)


    I know I’ve asked for a lot in the past, and I come to you with yet another request for help.

    Situation:
    Some time ago, I wanted to hide the address of the search results (for privacy reasons), and I followed the instructions here: https://forums.geomywp.com/topic/update-safe-changes-to-template-files/#post-33917. It worked great, except that the visual of the search results was always a bit rough. So, I’ve been trying to keep the functionality of keeping the addresses hidden, while using the CSS from one of the other templates.

    What I’ve tried:
    I tried copying and pasting the CSS code into the custom folder (/geo-my-wp/posts-locator/search-results/custom/css). This changes the look, which is what I’m after, but it also shows the addresses, which is what I’m trying to avoid.

    As well, I’ve tried copying/pasting the php code into the templates folder under plugins.

    Any help would be appreciated. I’ve been trying different things for the last 4 hours.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Eyal Fitoussi

    (@ninjew)

    Hello @barretd,

    I apologize for not replying sooner.

    Try the script below by adding it to the functions.php file of your theme.

    The only thing you need to change is the value “1” with the ID of your form.

    
    function gmw_custom_remove_address_from_search_results( $fields, $post, $gmw ) {
    
    	// replace 1 with the ID of your form.
    	if ( ! empty( $gmw['ID'] ) && 1 == $gmw['ID'] ) {
    		$fields = array();
    	}
    
    	return $fields;
    }
    add_filter( 'gmw_get_location_address_fields', 'gmw_custom_remove_address_from_search_results', 50, 3 );
    

    Let me know if this helps.

    • This reply was modified 5 years, 6 months ago by Eyal Fitoussi.
    Thread Starter BarretD

    (@barretd)

    You never have to apologize, Eyal. It worked perfectly. I thank you once again very much.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Cannot change search results by changing CSS while maintaining custom php’ is closed to new replies.