Title: Including plugin template tag inside functions.php
Last modified: August 20, 2016

---

# Including plugin template tag inside functions.php

 *  [Viktor Nagornyy](https://wordpress.org/support/users/viktorix/)
 * (@viktorix)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/including-plugin-template-tag-inside-functionsphp/)
 * Ok, I have plugin that generates a template tag which outputs `<a href="">link
   <span>1</span></a>` and I want to include it in the admin bar through the functions.
   php file. Here’s what I’m trying to do, but it’s not working.
 *     ```
       function wp_admin_custom_link() {
       global $wp_admin_bar, $wpdb;
       if ( !is_super_admin() || !is_admin_bar_showing() )
       return;
       $link_var = '<?php echo template_tag() ?>';
       /* Add the main siteadmin menu item */
   
       $wp_admin_bar->add_menu( array( 'id' => 'link var', 'title' => $link_var, 'href' => FALSE ) );
   
       }
       add_action( 'admin_bar_menu', 'wp_admin_custom_link', 1000 );
       ```
   
 * Not sure if there’s another way to pass that that template tag to functions.php
   file, would really appreciate help.

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

 *  Thread Starter [Viktor Nagornyy](https://wordpress.org/support/users/viktorix/)
 * (@viktorix)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/including-plugin-template-tag-inside-functionsphp/#post-2584227)
 * Would love some help on this, stuck. Tried everything, even pulling $var that
   the plugin uses to pass that info to the template tag by including that file 
   in functions file. Nothing.
 * I hate being stuck.
 *  Thread Starter [Viktor Nagornyy](https://wordpress.org/support/users/viktorix/)
 * (@viktorix)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/including-plugin-template-tag-inside-functionsphp/#post-2584423)
 * I guess this is harder to do than I thought.

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

The topic ‘Including plugin template tag inside functions.php’ is closed to new 
replies.

## Tags

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

 * 2 replies
 * 1 participant
 * Last reply from: [Viktor Nagornyy](https://wordpress.org/support/users/viktorix/)
 * Last activity: [14 years, 3 months ago](https://wordpress.org/support/topic/including-plugin-template-tag-inside-functionsphp/#post-2584423)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
