I am having issues with the get_the_terms php that is pulling in my current posts categories (custom taxonomy portfolio_category). I can successfully pull in the last category.
If you look at this page you'll see links along the top: http://www.slarc.com/portfolio-view/central-control-building-east-texas/ those links are pulled in via get_the_ters_list but the links don't have: www. slarc. com / projects in front of it. Where I need it to jump to a page with the same slug. That's why I started working with the code below. It works, but it only pulls in ONE taxonomy? This is the second line of links on the page: http://www.slarc.com/portfolio-view/central-control-building-east-texas/
PHP Code: ID, 'portfolio_category' );
if ( $terms && ! is_wp_error( $terms ) ) :
$portfolio = array();
foreach ( $terms as $term ) {
$portfolio[] = $term->name;
}
$portfolio_category = join( " | ", $portfolio );
?>
<h3 id="Proj_Categories"><ul>
<?php echo '<a href="http://www.slarc.com/projects/'.$term->slug.'">'.$term->name.'</a>'; ?>
</ul></h3>
<?php endif; ?>
How can I pull in all the taxonomies??
FYI-Ignore the links on top that show up. These are brough in with the get_the_terms_list
But those need the http:// www. slarc.com/ projects in front of the links.
Thanks, Lorne
EDIT (GOT THE WORKING CODE Thanks jfacemyer!):
PHP Code: ID, 'portfolio_category' );
if ( $terms && ! is_wp_error( $terms ) ) :
$portfolio = array();
foreach ( $terms as $term ) {
$portfolio[] = $term->name;
}
$portfolio_category = join( " | ", $portfolio );
?>
<h3 id='Proj_Categories'>
<?php
$url = site_url();
foreach ( $terms as $term ) {
$linklist .= "<li><a href='" . $url . "/projects/" . $term->slug . "'>" . $term->name . "</a></li>\n";
}
echo "<ul>" . $linklist . "</ul>";
?>
</h3>
<?php endif; ?>