NOTE PLEASE : for all of you who will mark this as a duplicate  THE ISSUE WAS NOT SOLVED USING CODE FROM THAT TOPIC. PLEASE DON'T MARK THIS AS A DUPLICATE BUT TRY TO HELP ME OUT. I'D REALLY APPRECIATE IT :)  Let me explain my issue.  I got a WordPress with 10,000 posts and like +6k of them have tittles longer than 65 characters which affects SEO.  I'm using this code to limit titles to 65 characters:  function tokenTruncate($title, $your_desired_width) { $parts = preg_split('/([\s\n\r]+)/', $title, null, PREG_SPLIT_DELIM_CAPTURE); $parts_count = count($parts);  $length = 0; $last_part = 0; for (; $last_part &lt; $parts_count; ++$last_part) { $length += strlen($parts[$last_part]); if ($length &gt; $your_desired_width) { break; } }  return implode(array_slice($parts, 0, $last_part));  $your_desired_width = 65;  if (strlen($title) &gt; $your_desired_width) { $title = wordwrap($title, $your_desired_width); $title = substr($title, 0, strpos($title, "\n")).'...'; return $title; }  add_filter('the_title','tokenTruncate');
50683
I have a code snippet written in PHP that pulls a block of text from a database and sends it out to a widget on a webpage.  The original block of text can be a lengthy article or a short sentence or two; but for this widget I can't display more than, say, 200 characters.  I could use substr() to chop off the text at 200 chars, but the result would be cutting off in the middle of words-- what I really want is to chop the text at the end of the last word before 200 chars.
103878
I've noticed the text of the Hot Meta Posts box is not within its limits. I guess this would happen for any question with a word that's long enough:
67340
Questions like:   ♦ ♦-should-discriminate-more-when-bumping-unanswered-questions ≠-users-who-want-to-write-good-posts   well, you can see there.  The diamond (and other problematic Unicode characters) in the title breaks the automatic prettification of internal question links.  This becomes a bit more of an issue when one wants to link to an answer.  For example ♦-break-the-automatic-hyperlink-parser/242572#242572 should link to Martijn's answer, but, it doesn't (tangent, but a different issue is that  which is the share link doesn't auto-prettify unless the userid part is removed - one keeps having to manually remove things to get the auto prettify to engage).  If one looks at the html generated for  for the title and the url linked in the &lt;h1&gt; of the page, we get:  &lt;title&gt;Users who can&amp;#39;t write good posts ≠ users who want to write good posts - Meta Stack Exchange&lt;/title&gt;     &lt;h1 itemprop="name"&gt; &lt;a href="/questions/238644/users-who-cant-write-good-posts-%e2%89%a0-users-who-want-to-write-good-posts" class="question-hyperlink"&gt;Users who can&amp;#39;t write good posts ≠ users who want to write good posts&lt;/a&gt; &lt;/h1&gt;   And while that's a long link title, I will point out that the quote as part of the word "can't" was removed from the slug.  The bug is that this should be done for other characters too.
79138
I just noticed that when a question's title is long enough that it would normally wrap around, it does so a tad late. If the title has a word in the right place, it gets cut off by the background(?!?) of the page.
90821
If I have a loop running from a category query like :  &lt;?php $the_query = new WP_Query('cat=1&amp;showposts=50&amp;orderby=title&amp;order=asc');?&gt; &lt;ul&gt; &lt;?php while ($the_query-&gt;have_posts()) : $the_query-&gt;the_post();?&gt; &lt;li&gt;.. &lt;/li&gt;&lt;?php wp_reset_query(); ?&gt; &lt;?php endwhile; ?&gt; &lt;/ul&gt;   How would I create an if clause that breaks the list at a certain interval, and starts a new one. So for example at the 10th post, return a &lt;/ul&gt; and start a new one &lt;ul&gt; at 11.  This is incorrect but to illustrate my objective:  &lt;?php $count =0;     while($count &lt;=50){         if ($count == 9){             echo "&lt;li&gt;&lt;a href='&lt;?php the_permalink(); ?&gt;'&gt;                       &lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;";             }          elseif ($count == 10){         echo "&lt;ul&gt;&lt;li&gt;&lt;a href='&lt;?php the_permalink(); ?&gt;'&gt;                           &lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/li&gt;";         }         else {         echo "&lt;li&gt;&lt;a href='&lt;?php the_permalink(); ?&gt;'&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/li&gt;";         }   What is the correct way to include this logic into the loop?
107412
When I tried to edit , I got an error saying the title must be at least 15 characters.  How did this come to happen (given that it is a new question)?   Shouldn't the title written during posting also be 15 characters? Is there some text which is removed during posting which could cause this? Like tags? Maybe it's because  are still allowed in the original post?
123539
I think this is a very recent design change, because I've not seen it before:    Where before a small box with the bounty value dislocated the title a couple of characters to the right, now the additional text saying how long until it expires dislocates the title by about a quarter of the width of the column.  I find that this makes it much harder to read the title, and is counterproductive to the goal of attracting attention.
118249
I have a basic understanding of  (I come across it often when I'm migrating WordPress installs) and I just discovered .  Given that serialize causes so much trouble with replacing strings in the database (eg. editing an optinos field directly), why does WordPress prefer serialize to (the seemingly similar) json_encode, which doesn't insert the string length into the stored value.  My first thought was that it may provide some security or error-checking benefits - WordPress will ignore the option if the string lengths are incorrect.. but I'm interested in a qualified explanation :)
643
Whenever you post some link that usually converts into one-box, if there's any text after it (space character between the link and text) then it doesn't get converted. Except for chat room links.  Try posting http://chat.meta.stackexchange.com/rooms/89/tavern-on-the-meta asdfasd  I think it's a bug that has to do with user-friendly room titles included in the link, which gets cut off with the rest of the message, without checking first if there is text after the link.
40142
For sites that have the new responsive theme enabled, where the "Ask Question" button is in line with the question title on question pages, the word wrap on long titles is not working correctly.  It will break a word across two lines.  Here is an  from Personal Finance and Money:  Maximum width, left nav hidden:   Narrow width:   This is also happening on beta sites.  Here is an  on Sports:    These screenshots were all taken on Firefox, but I am seeing the same problems in Chrome and Internet Explorer.  One more example:
39570
I tried to post the following comment and it claims it was less than 15 when it was more.  Based on Tim's comment and testing I believe it would not let me post because with @Shadow removed it is less than 15. However, the characters left message indicates I have passed the 15 character minimum thus it is wrong.  This is the bug I'm reporting:  The characters remaining message and the characters left message do not take into account striping out @name prefixes.
67211
In the comment field on StackOverflow (and other StackExchange sites as well, I presume) you're required to write 15 characters for the server to accept your post. If a shorter post is submitted, an information message states that the comment is too short. That is all good.  However, below the comment field is a counter, which counts up to 15 and then down from however many characters you're allowed to type minus fifteen. This counter doesn't always act the same as the actual validation: if I pad my message with whitespace, the validation notices and still says the message is too short, but the counter does not notice, and counts as usual.  Suggested fix: make the character counter trim the message before it counts, so the two messages say the same thing.
119906
Some of our form fields have character limits. We're debating whether we should reflect the current size of data entry, or to simply hard-limit and inhibit data entry beyond that size.  In HTML, simple &lt;input&gt; elements can have a maxlength attribute that inhibits further entry, but &lt;textarea&gt; has no built in option. Character limits in &lt;textarea&gt; can easily be imposed via javascript.  Twitter shows the remaining available characters, and will let you type more than that in but shows it as an error (and disables the action button).     We're looking at proactively showing the number of allowed characters for a limited field, and showing the number of characters remaining. If the user exceeds the limit then an inline form invalidation message appears.     A counter argument is that users don't even notice the little numbers updating, and that the user might well end up expending a great deal of effort typing something which they then need to trim.  What are some of the pros and cons of using these character counters?
5867
If you comment something on Stack Overflow, you need to enter at least 15 characters, and you can't post a comment which just contain spaces.  But if you type in zero-width spaces it will work. A zero-width space can be translated with &amp;#8203; in HTML.  For better understanding, I have added a zero-width space comment to my question.
116952
I am suggesting dramatically lowering the custom text characters allowed in any bounty from 3000 to the length of a comment (600). The reasons for this is as follows:  There are no  in bounty texts  There is only  available  That many characters in a single paragraph is completely TL;DR  Allowing 3000 characters is a strong suggestion you can use more complicated formatting which makes even short (with respect to the character limit) bounty texts    Probably 100x (or more) easier to implement this than adding full markdown to bounty text   Note that this entire post is barely 1/3 the allowed character limit.
116217
Is there a way to limit the number of words per post through the the_content() function or something similar?
74939
Here's my issue. I have a custom post type that I'm attaching a custom taxonomy to. This taxonomy will allow the admin to provide search suggestions that will ensure the post is found when a user searches. This taxonomy is also used on the front-end to autocomplete the search field with these suggestions.  The system works fine, except when the term contains a forward slash, a space or other "special" characters.  &lt;?php $keyword = 'Ski-in%2FSki-out';//Submitted via $_GET $keyword = urldecode($keyword); // (string)'Ski-in/Ski-out'  $taxQuery = new WP_Query(array(     'post_type' =&gt; 'ml_properties',     'tax_query' =&gt; array(         'relation' =&gt; 'OR',         array(             'taxonomy' =&gt; 'mc_tax_lifestyle',             'field' =&gt; 'name',             'terms' =&gt; array($keyword),             'operator' =&gt; 'IN'         )     ) )); ?&gt;   I've looked into using the escaping features provided by WordPress, but haven't had any luck there. I thought this would be a simple problem, but either my Google-fu is not strong, or I'm just not having any luck.  I've also verified that that Ski-in/Ski-out is the exact string stored in MySQL. I've looked into using esc_attr(), $wpdb-&gt;esc_like() and esc_sql() but none have an effect.  Perhaps I'm missing something obvious?