• Resolved tsekou

    (@tsekou)


    Hello, How could i display in a map different post types with different color markers? Is there a way to do this?

Viewing 1 replies (of 1 total)
  • Plugin Author dgamoni

    (@dgamoni)

    Hi
    you can updated custom field ‘locate-anything-marker-color’ on loop for each CPT
    eg

    $args = array(
    	'post_type' => 'place',
    	'post_status' => 'publish',
    	'posts_per_page'  => -1,
    );
    $the_query = new WP_Query( $args );
    
    while ( $the_query->have_posts() ) : $the_query->the_post();
    	update_post_meta( $post->ID, 'locate-anything-marker-color', 'red' )[0];
    endwhile;
    wp_reset_query();
    
    $args = array(
    	'post_type' => 'place2',
    	'post_status' => 'publish',
    	'posts_per_page'  => -1,
    );
    $the_query = new WP_Query( $args );
    
    while ( $the_query->have_posts() ) : $the_query->the_post();
    	update_post_meta( $post->ID, 'locate-anything-marker-color', 'blue' )[0];
    endwhile;
    wp_reset_query();					
    • This reply was modified 2 years, 9 months ago by Yui.
    • This reply was modified 2 years, 9 months ago by dgamoni.
Viewing 1 replies (of 1 total)
  • The topic ‘Different post types’ is closed to new replies.