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 4 replies, 2 voices, and was last updated 10 years, 1 month ago by
Steven Zahm.
-
AuthorPosts
-
06/24/2016 at 7:51 am #380491
Diego van der Heijden
ParticipantHi! I’m using cMap theme and I’m trying to use a shortcode from another plugin to display star ratings in the results. How do I use shortcodes in a text field?
Thanks
06/24/2016 at 7:59 am #380492Diego van der Heijden
ParticipantTo add on this: Shortcodes do work in the Bio and Notes fields, not in the text fields.
06/24/2016 at 9:20 am #380500Steven Zahm
Keymaster@ Diego van der Heijden
Right, shortcodes do work in the bio and notes fields but not the text custom fields. I suspect you’re following text custom field tutorial? If you are then change this line of code:
if ( ! empty( $text ) ) echo '<p>' . esc_html( $text ) . '</p>';to this:
if ( ! empty( $text ) ) echo '<p>' . do_shortcode( esc_html( $text ) ). '</p>';That should do the trick.
Hope that helps. Let me know.
ps. I’d be interested in seeing the result. Which reviews plugin are you using?
06/28/2016 at 6:23 pm #380843Diego van der Heijden
ParticipantThank you for your quick reply!
It’s not really working at the moment. I get this piece of code instead of the custom field for every entry:
$text = $entry->getMeta( array( ‘key’ => ‘reviewfields_id’, // This should match exactly the field id used when registering the custom field. ‘single’ => TRUE // Do not change this. ) ); if ( ! empty( $text ) ) echo ‘
‘ . do_shortcode( esc_html( $text ) ). ‘‘;
Kind regards
06/29/2016 at 9:59 am #380877Steven Zahm
Keymaster@ Diego van der Heijden
If you are seeing actual code in the template when you view the directory, then you need to move the code so that it is between
<?phpand?>tags. If it not between those tags, then it is being displayed as text and not run as code. -
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.
