10/08/2014 at 2:06 pm
#306402
Keymaster
@ Fabrice
Oh, you’re modifying the class.entry-output.php
. I thought you were using this within a template. I do not really recommend editing the core file like that because you’ll lose those changes in a plugin update.
If you’re goal is to display this on the frontend then it should really go in a template instead.
Any way to get it to with in the file you’re editing you need to use this:
// Grab an instance of the Connections object.
$instance = Connections_Directory();
$terms_r = $instance->term->getTermRelationships( $this->getId() );
$terms = cnTerm::get( 'category', array( 'child_of' => 73 ) );
foreach ( $terms as $term ) {
if ( ! in_array( $term->term_id, $terms_r ) ) continue;
echo $term->name;
}