Title: Code into template / exclude category?
Last modified: August 21, 2016

---

# Code into template / exclude category?

 *  Resolved [ufopsi](https://wordpress.org/support/users/ufopsi/)
 * (@ufopsi)
 * [13 years ago](https://wordpress.org/support/topic/code-into-template-exclude-category/)
 * Hi, I was wondering if it’s possible to do this: I need to embed a map into the
   loop (blog). The code should be
    `<?php echo do_shortcode('[wpgmza id="1"]');?
   >`
 * I need to show the map only in one blog category. Is it possible to exclude blog
   categories?
 * [http://wordpress.org/plugins/wp-google-maps/](http://wordpress.org/plugins/wp-google-maps/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [WPGMaps](https://wordpress.org/support/users/wpgmaps/)
 * (@wpgmaps)
 * [13 years ago](https://wordpress.org/support/topic/code-into-template-exclude-category/#post-4132307)
 * Hi
    Sorry for the delay What you could do is try this:
 *     ```
       <?php
       if ( in_category( 'pachyderms' )) {
         echo do_shortcode('[wpgmza id="1"]');
       }
       ?>
       ```
   
 * Where “pachyderms” is the name of the category
 * Does this help?
 * Kind regards
    Nick

Viewing 1 replies (of 1 total)

 The topic ‘Code into template / exclude category?’ is closed to new replies.

 * ![](https://ps.w.org/wp-google-maps/assets/icon-256x256.gif?rev=3576706)
 * [WP Go Maps - Google Map, OpenStreetMap, Leaflet Map](https://wordpress.org/plugins/wp-google-maps/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-google-maps/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-google-maps/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-google-maps/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-google-maps/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-google-maps/reviews/)

## Tags

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

 * 1 reply
 * 2 participants
 * Last reply from: [WPGMaps](https://wordpress.org/support/users/wpgmaps/)
 * Last activity: [13 years ago](https://wordpress.org/support/topic/code-into-template-exclude-category/#post-4132307)
 * Status: resolved