Title: Using shortcode in header.php
Last modified: August 20, 2016

---

# Using shortcode in header.php

 *  Resolved [Ironstone](https://wordpress.org/support/users/ironstonegardens/)
 * (@ironstonegardens)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/using-shortcode-in-headerphp/)
 * I want to be able to use the [notphone] shortcode in the header.php to change
   the logo used depending upon if it’s a phone or desktop/tablet.
 * How can I do this? I’m trying to put it “around” this:
 * </h1>
 * Many thanks.
 * [http://wordpress.org/extend/plugins/wp-mobile-detect/](http://wordpress.org/extend/plugins/wp-mobile-detect/)

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

 *  Thread Starter [Ironstone](https://wordpress.org/support/users/ironstonegardens/)
 * (@ironstonegardens)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/using-shortcode-in-headerphp/#post-3571788)
 * Sorted this now.
 *  [7corvus7](https://wordpress.org/support/users/7corvus7/)
 * (@7corvus7)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/using-shortcode-in-headerphp/#post-3572007)
 * Hi,
    how did you solve that? can you post some code example of using [phone] [/
   phone] ?
 * Thanks
 *  [voldby](https://wordpress.org/support/users/voldby/)
 * (@voldby)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/using-shortcode-in-headerphp/#post-3572011)
 * Ironstone – what is the point of asking in a forum, post that you have figured
   it out yourself, and not posting the solution?
 *  [mtuttle](https://wordpress.org/support/users/mtuttle/)
 * (@mtuttle)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/using-shortcode-in-headerphp/#post-3572014)
 * Here’s how I got it to work for my theme, since the developer and the original
   poster seem checked out.
 *     ```
       <?php
           if (function_exists('wpmd_is_phone') && wpmd_is_phone()) {
               echo "<li><a class='phone' href='tel:" . ot_get_option('phonenumbercontent') . "'><span class='phone'>" . ot_get_option('phonenumbercontent') ."'</span></a></li>";
           } else {
               echo "<li><span class='phone'>" . ot_get_option('phonenumbercontent') . "</span></li>";
           }
       ?>
       ```
   

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

The topic ‘Using shortcode in header.php’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-mobile-detect.svg)
 * [WP Mobile Detect](https://wordpress.org/plugins/wp-mobile-detect/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-mobile-detect/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-mobile-detect/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-mobile-detect/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-mobile-detect/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-mobile-detect/reviews/)

## Tags

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

 * 4 replies
 * 4 participants
 * Last reply from: [mtuttle](https://wordpress.org/support/users/mtuttle/)
 * Last activity: [12 years, 11 months ago](https://wordpress.org/support/topic/using-shortcode-in-headerphp/#post-3572014)
 * Status: resolved