Title: Shortcode in template &#8211; not working
Last modified: August 21, 2016

---

# Shortcode in template – not working

 *  Resolved [AontachtS](https://wordpress.org/support/users/aontachts/)
 * (@aontachts)
 * [13 years ago](https://wordpress.org/support/topic/shortcode-in-template-not-working/)
 * Hi,
 * I’m trying to display two different telephone numbers based on whether a user
   is located in the UK or ROI.
 * In my theme I’ve edited the original template from
    `<?php if (isset($woo_options['
   woo_contact_number']) && $woo_options['woo_contact_number'] != '' ) { ?><li><?
   php _e('Tel:','woothemes'); ?> <?php echo esc_html( $woo_options['woo_contact_number']);?
   ></li><?php } ?>`
 * to
 * `<?php if (isset($woo_options['woo_contact_number'])) { ?><li><?php _e('Tel:','
   woothemes'); ?> <?php echo do_shortcode( '[CBC country="ie"]'0000 000 0000'[/
   CBC]''[CBC country="gb"]'1111 111 1111'[/CBC]'); ?></li><?php } ?>`
 * but this is resulting in a 500 server error. I’m definitely doing something wrong,
   but I can’t figure out what.
 * On a possibly related note, I’ve tried using the shortcode in a post and the 
   only content of the post showing is the control text I’ve been using.
 * Thanks,
 * [http://wordpress.org/extend/plugins/custom-content-by-country/](http://wordpress.org/extend/plugins/custom-content-by-country/)

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

 *  Thread Starter [AontachtS](https://wordpress.org/support/users/aontachts/)
 * (@aontachts)
 * [13 years ago](https://wordpress.org/support/topic/shortcode-in-template-not-working/#post-3649812)
 * A minor update to the above post, I’m currently located in the UK.
 * When I change the test code in the post to read [CBC country=”gb” show=”n”]UK[/
   CBC] I am shown UK.
 * When I change the test code in the post to read [CBC country=”gb” show=”y”]UK[/
   CBC] the text is hidden.
 * I’ve checked my IP on IP2Nation and it is recognised as being in the UK.
 *  Plugin Author [Paul](https://wordpress.org/support/users/paultgoodchild/)
 * (@paultgoodchild)
 * [13 years ago](https://wordpress.org/support/topic/shortcode-in-template-not-working/#post-3649977)
 * I’m not sure as to the 500 error… that is probably beyond my ability to debug
   I think. Check your server/hosting logs to see if there are any clues there.
 * I’ll review the code again to see if there’s a mix-up in the logic and I’ll get
   back to you shortly.
 * Thanks for reporting it.
 *  Thread Starter [AontachtS](https://wordpress.org/support/users/aontachts/)
 * (@aontachts)
 * [13 years ago](https://wordpress.org/support/topic/shortcode-in-template-not-working/#post-3649981)
 * Hi Paul,
 * I’ll have a look through my server log to see if I can find the cause of the 
   problem in there.
 * After checking and rechecking the code, I think the problem is related to the
   theme and not the plugin so I’ll get in touch with WooThemes and see if they 
   have any suggestions.
 * Thanks,

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

The topic ‘Shortcode in template – not working’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/custom-content-by-country.svg)
 * [Custom Content by Country (by Shield Security)](https://wordpress.org/plugins/custom-content-by-country/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/custom-content-by-country/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/custom-content-by-country/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-content-by-country/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-content-by-country/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-content-by-country/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [AontachtS](https://wordpress.org/support/users/aontachts/)
 * Last activity: [13 years ago](https://wordpress.org/support/topic/shortcode-in-template-not-working/#post-3649981)
 * Status: resolved