title: Adding a class to Wordpress post_class using add_filter in functions.php
body: <p>I'm trying to add an extra class to all posts of a certain type- I'm currently getting a blank page after adding this to functions.php</p>
  
  <p>I need to add the class "post" only where the $classes contain the string "toefl_post".</p>
  
  <p>Here is my code:</p>
  
  <pre><code>function add_post_class($classes) {
  
  $tester = strpos($classes,'toefl_post');
  $additional = 'post'
  
  if($tester === false) {
   // string NOT found
      return $classes;
  }
  else {
  
   // string found
        $classes = $classes + $additional;
      return $classes;
  };
  }
  
  add_filter('post_class', 'add_post_class');
  </code></pre>
  
  <p>I'm pretty new to PHP so I'm guessing something is wrong with the code- Would really appreciate any help.</p>