We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36573
    • 173 Posts
    I'm pulling content from articles, but some article have images at the beginning. I'm trying to skip the image tag and start the count at the text. I'm using PDOResourses.

    [[+content:striptags=`img`]]
      Everything I know I learned on the internet. Saved me thousands in College tuition,
      • 37105
      • 194 Posts
      You could use a custom snippet to get there.

      Make a snippet with this code
      <?php
      // strip tags including content
      $output = preg_replace('@<('.$tagToStrip.')[^>]*>.*?</\1>@is', '', $stringToStrip);
      return $output;


      In the code where you want to want the stripped result call the snippet like this
      [[StripThis? &stringToStrip=`[[+content]]` &tagToStrip=`img`]]


      Note: where StripThis is the name you gave to the snippet.

      If you want more tags to strip simply add the tag in param &tagToStrip ( e.g. &tagToStrip=`img | span | div` )
        Codeplaza Webdesign: for professional websites at low cost
        • 36573
        • 173 Posts
        Thanks Don, Someday I'll put my big boy pants on and learn me some PHP!
          Everything I know I learned on the internet. Saved me thousands in College tuition,