• Resolved extendWP

    (@taz_bambu)


    Hello and many thanks for the wonderful plugin.

    I have created a front end form to allow users submit a custom post type.

    Now, I have created a page to show the mashup.

    I am trying to allow users , apart from just having a look to the mashup,
    to be able to search through it bu the use of an input field for the area / location (i have custom fields for city and country etc. apart from pronamic address meta).

    So far I have built this:

    [ Moderator Note: Please post code or markup snippets between backticks or use the code button. ]

    <form action="" method="post" name="searchgroup" id="searchgroup"><fieldset>
    <legend>Search for Groups in your Area!</legend>
    	<input type="text"  name="address" id="address"  placeholder="type your area" placeholder="Type your Area"/>
    	<input type="submit"  name="submit" id="submit" value="Go"/>
    
    <?php
    
    $input = $_POST['address'];
    $query1 = new WP_Query( array('post_type' => 'any' ));
    $query2 = new WP_Query( array('meta_value' => $input ));
    
    if (	get_post_meta( get_the_ID() ) == $input	)
    	{pronamic_google_maps_mashup($query2);
    	}
    else pronamic_google_maps_mashup($query1);
    
    ?>

    My query for the meta value does not work yet.

    Any ideas?
    Am I missing something? Is there any other way to do that?

    Thank you in advance!

    https://www.ads-software.com/extend/plugins/pronamic-google-maps/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Remco Tolsma

    (@remcotolsma)

    This goes a little beyond the support we can give on our free Google Maps plugin. But maybe you can figure it out with the following example:

    $args = array(
    	'meta_query' => array(
    		'relation' => 'OR',
    		array(
    			'key' => 'your_city_meta_key',
    			'value' =>  $input,
    			'compare' => 'LIKE'
    		),
    		array(
    			'key' => 'your_country_meta_key',
    			'value' =>  $input,
    			'compare' => 'LIKE'
    		),
    		array(
    			'key' => '_pronamic_google_maps_address',
    			'value' =>  $input,
    			'compare' => 'LIKE'
    		)
    	)
     );
    
    $query = new WP_Query( $args );

    See for more information also the WordPress documentation:
    https://codex.www.ads-software.com/Function_Reference/WP_Query#Custom_Field_Parameters

    Thread Starter extendWP

    (@taz_bambu)

    Thanks very much for your prompt support.
    I am testing this in the mean time.

    Regards
    tasos

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Pronamic Google Maps] SEARCH PRONAMIC MASHUP’ is closed to new replies.