Open jan1980 opened 3 months ago
Hello, could you show me an easy way to show a "general map" with all markers from all posts? I've been trying this to no avail (it only works when I add a single ID):
add_shortcode( 'open_street_map_special', 'osm_spec' ); function osm_spec_init(){ function osm_spec() { $all_post_ids = get_posts(array( 'fields' => 'ids', 'posts_per_page' => -1, 'post_type' => 'it-suppliers' )); $map_ids = implode(',', $all_post_ids); $short = '[acf field="it_company_address" post_id="'.$map_ids.'"]'; echo do_shortcode($short); } } add_action('init', 'osm_spec_init');
Hello, could you show me an easy way to show a "general map" with all markers from all posts? I've been trying this to no avail (it only works when I add a single ID):