By gthing on
Hello, I am trying to get my theme to print the primary link title and the description (normally shown as the alt tag) in such a way that I can easily theme them with my css. Problem is, I'm having a hard time getting the description to print out.
Here is the code I am using:
<?php if (is_array($primary_links)) : ?>
<?php foreach ($primary_links as $link): ?>
<div class="linkbarlink"><?php
$href = $link['href'] == "<front>" ? base_path() : base_path() . $link['href'];
print "<h2><a href='" . $href . "'>" . $link['title'] . "</a></h2>";
print "<h3><a href='" . $href . "'>" . $link['description'] . "</a></h3>";
?></div>
<?php endforeach; ?>
<?php endif; ?>
The second print line does nothing. I checked my database and it looks like "description" is the right identifier, but apparently I'm going wrong somewhere...
Any ideas?
Comments
You're looking for <?php
You're looking for
$link['attributes']['title'];