I am setting up views to show results on the front end, so I have a shot description box that has any amount of text, this will appear on the full page, however on the listing page I want to reduce this box to a specific amount of characters that are shown..this is the code added, but I do not have an option to limit characters.
[types field='coach-holiday-description'][/types]
I would also like to add three period dots at the end of the reduced character text.
Thank you Minesh for your support. I have not applied any code at the moment. Should I consider a different code implementation or would it be best to use what you have suggested above?
Where:
- Replace the "your-custom-field-slug" with your original custom field slug.
- Replace the "length" attribute value as required, currently its set to 50.
Unfortunately, I am receiving an error on line 14 of the code snippet:
syntax error, unexpected single-quoted string "string", expecting ")" in /home/callejh/www/wp-content/toolset-customizations/limit-characters.php on line 14
** Se ha actualizado en fragmento "limit-characters".
Ocurrió un error al tratar de volver a ejecutar el fragmento.syntax error, unexpected single-quoted string "string", expecting ")" in /home/callejh/www/wp-content/toolset-customizations/limit-characters.php on line 14 A problem occurred when executing snippet "limit-characters". The result of include_once is: ""
The code now works without errors but unfortunately after applying the code below I am not seeing any reduction of characters. The field is still displaying all of the text and I am expecting it to be reduced to 5 characters with trailing ....