Title: Embed into template
Last modified: August 21, 2016

---

# Embed into template

 *  Resolved [ufopsi](https://wordpress.org/support/users/ufopsi/)
 * (@ufopsi)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/embed-into-template/)
 * Hi, is it possible to embed a map directly into the blog loop, yet excluding 
   some categories?
 * Thanks.
 * [http://wordpress.org/plugins/leaflet-maps-marker/](http://wordpress.org/plugins/leaflet-maps-marker/)

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

 *  Thread Starter [ufopsi](https://wordpress.org/support/users/ufopsi/)
 * (@ufopsi)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/embed-into-template/#post-4132127)
 * I know this code works:
    `<?php echo do_shortcode('[mapsmarker layer="1"]'); ?
   >`
 * I just need to tell WP if the category ID is not 2, do not execute do_shortcode.
   Any ideas?
 *  Plugin Author [Robert Seyfriedsberger](https://wordpress.org/support/users/harmr/)
 * (@harmr)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/embed-into-template/#post-4132211)
 * solution depends on how you implemented your loops – try searching Google for“
   wordpress loop exclude category”
    best, Robert
 *  Thread Starter [ufopsi](https://wordpress.org/support/users/ufopsi/)
 * (@ufopsi)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/embed-into-template/#post-4132251)
 * Hi, thanks for the tip. This works in archives.php:
 *     ```
       <!-- Google Maps for SPASS -->
       <?php if (in_category('Pratiche SPASS'))
       echo do_shortcode('[mapsmarker layer="1"]');			?>
        <!-- End Google Maps -->
       ```
   
 * Feel free to add this to the documentation. 🙂
 *  Plugin Author [Robert Seyfriedsberger](https://wordpress.org/support/users/harmr/)
 * (@harmr)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/embed-into-template/#post-4132290)
 * thanks!

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

The topic ‘Embed into template’ is closed to new replies.

 * ![](https://ps.w.org/leaflet-maps-marker/assets/icon.svg?rev=970936)
 * [Leaflet Maps Marker (Google Maps, OpenStreetMap, Bing Maps)](https://wordpress.org/plugins/leaflet-maps-marker/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/leaflet-maps-marker/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/leaflet-maps-marker/)
 * [Active Topics](https://wordpress.org/support/plugin/leaflet-maps-marker/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/leaflet-maps-marker/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/leaflet-maps-marker/reviews/)

## Tags

 * [categories](https://wordpress.org/support/topic-tag/categories/)
 * [embed](https://wordpress.org/support/topic-tag/embed/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [template](https://wordpress.org/support/topic-tag/template/)

 * 4 replies
 * 2 participants
 * Last reply from: [Robert Seyfriedsberger](https://wordpress.org/support/users/harmr/)
 * Last activity: [12 years, 8 months ago](https://wordpress.org/support/topic/embed-into-template/#post-4132290)
 * Status: resolved