<?xml version="1.0" encoding="UTF-8"?>    <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
      <channel>
        <title>How do I echo the first 150 characters of a WYSIWYG?</title>
        <link>https://interactivetools.com/forum/forum-posts.php?How-do-I-echo-the-first-150-characters-of-a-WYSIWYG-80887</link>
        <description></description>
        <pubDate>Tue, 14 Jul 2026 09:26:32 -0700</pubDate>
        <language>en-us</language>
        <atom:link href="https://interactivetools.com/forum/forum-posts.php?rss=1&amp;How-do-I-echo-the-first-150-characters-of-a-WYSIWYG-80887" rel="self" type="application/rss+xml" />

                <item>
          <title>How do I echo the first 150 characters of a WYSIWYG?</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2240344#post2240344</link>
          <description><![CDATA[<p>Hey zip222,</p>
<p>Give this a try. You'll need to modify the record referenced and your max words count for your needs... but it should do the trick. I use it in the same manner.</p>
<p>Add MAX Words above your  &lt;!DOCTYPE HTML&gt;.</p>
<p><code>&lt;?php <br />// MAX Words<br />function maxWords($textOrHtml, $maxWords) {  <br />   <br />  $text  = strip_tags($textOrHtml, " ");  <br />  $words = preg_split("/\s+/", $text, $maxWords+1); <br />   <br />  if (count($words) &gt; $maxWords) { unset($words[$maxWords]); }  <br />  $output = join(' ', $words);  <br />   <br />  return $output;  <br />}<br />?&gt;<br /><br />&lt;!DOCTYPE HTML&gt;<br /><br />&lt;html&gt;<br />    &lt;head&gt;<br /></code></p>
<p>Add as you meta description, and replace "$aboutRecord" with your appropriate record info.</p>
<p><code>&lt;meta name="description" content="&lt;?php echo maxWords($<strong>aboutRecord</strong>['content'], 32); ?&gt;" /&gt;</code></p>
<p>Zicky</p>]]></description>
          <pubDate>Tue, 21 Mar 2017 14:59:35 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2240344#post2240344</guid>
        </item>
                <item>
          <title>How do I echo the first 150 characters of a WYSIWYG?</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2240343#post2240343</link>
          <description><![CDATA[<p>How do I echo the first 150 characters of a WYSIWYG?</p>
<p>I am trying to use the content for a meta description tag.</p>
<p>I will need to strip out any HTML.</p>
<p>thanks :)</p>
<p><code>&lt;?php echo $page['content']; ?&gt;<br /><br />change to...<br /><br /><br /></code></p>
]]></description>
          <pubDate>Tue, 21 Mar 2017 08:50:52 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2240343#post2240343</guid>
        </item>
              </channel>
    </rss>
  