Title: Execute Shortcode In Header Code Snippet
Last modified: September 26, 2023

---

# Execute Shortcode In Header Code Snippet

 *  [jlanpheer](https://wordpress.org/support/users/jlanpheer/)
 * (@jlanpheer)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/execute-shortcode-in-header-code-snippet/)
 * Hi, hope someone can help me with this. I’m using Code Snippets to create a menu
   in the header above the defacto main menu with some miscellaneous links for a
   client. One of those links is to use the Google Translate plugin (shortcode: [
   gTranslate]) to translate the site back and forth between Spanish and English.
 * I’ve got the new topline menu created and i am trying to figure out how to incorporate
   the shortcode into the HTML. It appears that i cannot embed php tags in the Global
   Header and Footer sections? I get errors when i try that. Obviously, i can create
   PHP snippets but i can’t seem to embed PHP into the Global Header snippet.
 * This is roughly what i am trying to do:
 *     ```wp-block-code
       <li class="translate-page"><a class="topline-menu-a" href="NOT SURE WHAT GOES HERE, [gTranslate] won't work" role="menuitem"></a><a id="aSpanish" onclick="changeLanguage()" style="cursor: pointer;">
       ```
   
 * Can anyone help me out with this? THANK YOU!

Viewing 1 replies (of 1 total)

 *  Plugin Author [Shea Bunge](https://wordpress.org/support/users/bungeshea/)
 * (@bungeshea)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/execute-shortcode-in-header-code-snippet/#post-17081927)
 * Hi [@jlanpheer](https://wordpress.org/support/users/jlanpheer/),
 * Are you able to provide a screenshot of the snippets screen for us?

Viewing 1 replies (of 1 total)

The topic ‘Execute Shortcode In Header Code Snippet’ is closed to new replies.

 * ![](https://ps.w.org/code-snippets/assets/icon.svg?rev=2148878)
 * [Code Snippets](https://wordpress.org/plugins/code-snippets/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/code-snippets/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/code-snippets/)
 * [Active Topics](https://wordpress.org/support/plugin/code-snippets/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/code-snippets/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/code-snippets/reviews/)

## Tags

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

 * 1 reply
 * 2 participants
 * Last reply from: [Shea Bunge](https://wordpress.org/support/users/bungeshea/)
 * Last activity: [2 years, 8 months ago](https://wordpress.org/support/topic/execute-shortcode-in-header-code-snippet/#post-17081927)
 * Status: not a support question