• Resolved mlh1407

    (@mlh1407)


    I have been working on a solution wherein i could implement some jquery stuff in the pluging – and in order to not mod the plugin (as i started with) i started building a template for my theme instead – its better than messing up Ian´s code 🙂
    So if anyone could or would have the use of such – here is a simple way to get the placemarksdata from the plugin.

    template drawing categories :

    <?php
    /*
    Template Name: _forum
    */
    //
    ?>
    
    <?php get_header(); ?>
    
         <?php $category_args = array(
        'orderby'            => 'name',
        'order'              => 'ASC',
    	'taxonomy' 			 => 'bgmp-category'
    	);
    	//
    	$category_names = array();
    	$categories;
    
    	if( $posts )
    				{
    	echo '<div id="filters">';
    
    	$categories = get_categories( $category_args );
     		foreach ($categories as $category) {
    			$name = $category->cat_name;
    			$nice = $category->category_nicename;
    			$id = $category->cat_ID;
    			//
    			echo '<a> '. $name .'</a>';
    			//
    		}
    
    	echo '</div><!-- End filters -->';
    	//
         }
    	 ?>
    <?php get_footer(); ?>

    and then how to get the content based on these categories :

    <?php
    $queryString = 'fish,boat,flag,car' ; // the categroies from which we want to recieve placemarks
    	   	$lookUpArgs = array(
       'numberposts' => -1,
       'orderby' => 'rand',
       'post_type' => 'bgmp',
       'bgmp-category' =>  $queryString,//bgmp-category
       'post_status' => 'publish'
    	);
    	   //
    
    		$posts = get_posts( $lookUpArgs );	
    
    		if( $posts )
    				{
    					foreach( $posts as $p ) //loop stop
    					{
    					 	$title	= $p->post_title;
    						$address	= get_post_meta( $p->ID, 'bgmp_' . 'address', true );
    						$latitude	= get_post_meta( $p->ID, 'bgmp_' . 'latitude', true );
    						$longitude	= get_post_meta( $p->ID, 'bgmp_' . 'longitude', true );
    						$details	= $p->post_content;
    						// this loop will give you somethng to play with 
    
    						}//foreach stop
    		 }//if posts stop
    
    	wp_reset_query();
    
    ?>

    i myself started out building the map with jquery ui map and then put my jquery ui on top of that solution – but one could also make a filter drop-down-box before or after the map and then make a do_shortcode solution (somehow) — anyways. If you have any questions just write – by the way – great plugin

    http://ww.wp.xz.cn/extend/plugins/basic-google-maps-placemarks/

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

The topic ‘[Plugin: Basic Google Maps Placemarks] placemark theme template test’ is closed to new replies.