How do I set a character limit on the_content() and the_excerpt() in wordpress? I have only found solutions for the word limit - I want to be able to set an exact amount characters of outputted.
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
Replace
<?php the_content();?>
by the code belowphp substr() function refrence
php strip_tags() function refrence
just to help, if any one want to limit post length at
home page
.. then can use below code to do that..the below code is simply a modification of
@bfred.it
SirThis also balances HTML tags so that they won't be left open and doesn't break words.