Adding $terms to the byline in node.tpl.php for Drupal 7 and Acquia Prosper & Fusion Framework I'm trying to add the taxonomy term for a blog post to node--blog.tpl.php for the Fusion Framework and the Acquia Prosper Theme, but I've run in to some trouble and I'm not sure why it's not working.

The goal is to have the authorship line look like this:

By Blog Author | Posted Thursday March 14, 2013 | Filed under [Category Taxonomy Term name]

Here is the code I've got in there currently:

&lt;?php if ($display_submitted &amp;&amp; isset($submitted) &amp;&amp; $submitted): ?&gt;
&lt;div class="submitted terms terms-inline"&gt;&lt;em&gt;By&lt;/em&gt; &lt;?php print $name; ?&gt; | &lt;em&gt;Posted&lt;/em&gt; &lt;?php print format_date($node-&gt;created, 'custom', 'l F j, Y'); ?&gt; &lt;?php if $terms: ?&gt; | &lt;em&gt;Filed under&lt;/em&gt; &lt;?php print $terms; ?&gt;&lt;?php endif; ?&gt;&lt;/div&gt;
&lt;?php endif; ?&gt;


I've tried several different things, but I can't get anything to work. I'm thinking it should a simple fix, but I've not been able to make it work. 

The tpl.php file tells me that $terms should be available to me as a variable, but I've tried everything I can think of to no avail. I'd appreciate any help you can offer!
If you look at the Drupal 7 documentation for the variables available by default in the node.tpl file, $terms is not on the list: http://api.drupal.org/api/drupal/modules!node!node.tpl.php/7 

If you want to display additional variables in your template files (from what's already there by default), you should make sure that these additional variables are actually being set in your template.php file first.  

So, go into your theme's directory and find the file called template.php.  Does it have one of the following preprocess functions, in which it adds additional variables for your template file:


THEME-NAME_preprocess_node() or
THEME-NAME_preprocess_node_blog() (assuming your content type's machine name is 'blog')


If either of those exist in your theme's template.php file, look to see if the $terms variable is being set in a statement that should start with 

$variables['terms'] = ...


If that is not happening in the template.php file, then the variable is never being set and will be empty.  

If your theme's preprocessing isn't somehow prepping that variable for you, however, you can still try printing out your tags this way:

 &lt;?php print render($content['field_tags']); ?&gt; 


Where you can substitute 'field_tags' with any field you have on that node. :-)