PHP WordPress - Limit # of Words

<?php $content = 'Bacon ipsum <b>dolor</b> amet ball tip ribeye reprehenderit, bacon picanha laborum elit eu tempor. Ham hock salami fatback, shankle anim tri-tip pig commodo sausage lorem. Filet cupim pastrami. Spare ribs ball tip fatback pig lorem meatball. Capicola pork loin cillum, excepteur non sirloin adipisicing t-bone kevin tongue sed. Laboris deserunt sint occaecat voluptate bresaola ad laborum hamburger. Ex cupidatat eiusmod qui pastrami proident corned beef ball tip boudin duis irure. Tri-tip ex tongue prosciutto culpa, short ribs kevin cillum shankle t-bone nulla short loin ham. '; $words = wp_trim_words ( $content, 10, '... That\'s 10 Words!!!' ); echo $words;

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.