Problem:
The issue here is that the user wanted to limit the word that is being displayed from a custom field in php.
Solution:
The user is currently using this to display his custom field using PHP
<?php if(types_render_field("author-member-new-bio", array('class'=>''))){?> <?php echo(types_render_field("author-member-new-bio", array('class'=>''))); ?> <?php }?>
This can be done by using the wp_trim_words function as you can see from this it can be used to trim the words.
<p class="paragraph-about"><?php echo wp_trim_words( get_field('author_member_new_bio'), 60, '...' ); ?></p>
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 9:00 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | - |
- | 13:00 – 18:00 | 13:00 – 18:00 | 13:00 – 18:00 | 14:00 – 18:00 | 13:00 – 18:00 | - |
Supporter timezone: America/Jamaica (GMT-05:00)
This topic contains 3 replies, has 2 voices.
Last updated by 6 years, 6 months ago.
Assisted by: Shane.