Support has been upgraded!
The Support Forum is closed. Not to worry! Providing the top quality support you expect and we're known for will continue! We're not ending support, just changing where you submit requests. This will provide you with the best experience possible.
Premium Support
Have you purchased an addon for Connections such as one of our premium templates or extensions with a valid license and you need help?
Please open a Support Ticket in your user account.
Free Support
Are you using the free Connections plugin? Don't worry, you are still very important to us! We are still providing you with the same high quality support that we're known for.
Please open a new support topic in the WordPress support forums for Connections.
- This topic has 14 replies, 2 voices, and was last updated 11 years, 10 months ago by
Steven Zahm.
-
AuthorPosts
-
10/08/2014 at 1:44 pm #306399
Fabrice Locher
ParticipantHey Steven
Yes, exactly!
I have tried the code, but get the error:
Fatal error: Call to a member function getID() on a non-object in /data/www/www226/www/wp-content/plugins/connections/includes/entry/class.entry-output.php on line 2461Thanks you so much for your help!!! Great support!
Regards
Fabrice10/08/2014 at 2:02 pm #306400Steven Zahm
Keymaster@ Fabrice
Hmmm, funny, sort of I was testing with the exact code and didn’t get an error (I should have). use this:
// Grab an instance of the Connections object. $instance = Connections_Directory(); $terms_r = $instance->term->getTermRelationships( $entry->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; }If I have not asked and you have a moment, I would truly appreciate a review as they really do make a difference. Many thanks in advance!
http://wordpress.org/support/view/plugin-reviews/connections10/08/2014 at 2:06 pm #306402Steven Zahm
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; }10/08/2014 at 2:12 pm #306403Fabrice Locher
ParticipantHey Steven
Wow, now it works great!
Yeah, i really don’t want to editing the core file, but I don’t know how or where I must add the code in the template :(I have copied the
getCategoryBlock()function in theclass.entry-output.phpIs it possible to move this code into the template?
Thanks!
Regards
10/08/2014 at 6:39 pm #306451Steven Zahm
Keymaster@ Fabrice
I assumed since this was posted within the Slim Plus template that you were editing it. You would add the code to either the
card.phporcard-single.phpwhere you want to display the category details.If you do decide to do that, then I recommend following this QuickTip so cahnges to the template are update safe.
Hope that helps!
-
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.
