Why is my field not showing up in the template? I created a new field of the type Link for the Basic page content type and the field name is field_secondary_links. 

All the pages on the site operate based on custom templates and I edited node--page.tpl.php in order to show the links on the page. I added this:

&lt;div id="secondary-links"&gt;&lt;?php print render($content['field_secondary_links']); ?&gt;&lt;/div&gt;


The div appears in the HTML structure, but it turns out empty, even though I know for sure the fields aren't empty. What am I doing wrong? 

Using print_r($node), I found out the field is indeed there:

[field_secondary_links] =&gt; Array
        (
            [und] =&gt; Array
                (
                    [0] =&gt; Array
                        (
                            [url] =&gt; http://www.google.com
                            [title] =&gt; Link 1
                            [attributes] =&gt; Array
                                (
                                )

                            [html] =&gt; 1
                            [query] =&gt; 
                            [fragment] =&gt; 
                            [absolute] =&gt; 1
                            [display_url] =&gt; http://www.google.com
                        )

                    [1] =&gt; Array
                        (
                            [url] =&gt; http://ww.google.com
                            [title] =&gt; Link 2
                            [attributes] =&gt; Array
                                (
                                )

                            [html] =&gt; 1
                            [query] =&gt; 
                            [fragment] =&gt; 
                            [absolute] =&gt; 1
                            [display_url] =&gt; http://ww.google.com
                        )

                    [2] =&gt; Array
                        (
                            [url] =&gt; http://www.google.com
                            [title] =&gt; Link 3
                            [attributes] =&gt; Array
                                (
                                )

                            [html] =&gt; 1
                            [query] =&gt; 
                            [fragment] =&gt; 
                            [absolute] =&gt; 1
                            [display_url] =&gt; http://www.google.com
                        )

                )

        )
Your code is right. If field_secondary_links is in $content, it should be rendering it out. You might want to double check that the field is named correctly. If you have devel installed, try using dpm($content) to make sure the field is in there, that it is named right, and the the correct data is getting pulled in.

EDIT =======================================================
If $content is unavalible for whatever reason, you can still render this from $node, but it's a bit diffrent. Your code should look like this:

&lt;div id="secondary-links"&gt;&lt;?php  print render(field_view_field('node', $node, 'field_secondary_links', array('label'=&gt;'hidden'))); ?&gt;&lt;/div&gt;


You can remove the array('label'=&gt;'hidden') from field_view_field() if you want the label to show up.

That should prerender and then render the field for you. Not sure why your $content is missing though, but this should be a workable work-around.