Title: Getting  Illegal string offset &#039;classroom&#039; error
Last modified: August 21, 2016

---

# Getting Illegal string offset 'classroom' error

 *  [Noumaan Yaqoob](https://wordpress.org/support/users/noumaan/)
 * (@noumaan)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/getting-illegal-string-offset-classroom-error/)
 * I am getting this error when I try to display the weekly classroom schedule in
   a page using the shortcode [wcs]
 * Warning: Illegal string offset ‘classroom’ in C:\xampp\htdocs\test2\wp-content\
   plugins\weekly-class-schedule\controllers\WcsOutputController.php on line 11
 * Using the plugin with WordPress 3.6.1 with Twenty Twelve theme. Any ideas how
   to resolve this?
 * [http://wordpress.org/plugins/weekly-class-schedule/](http://wordpress.org/plugins/weekly-class-schedule/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [jonbenwaa](https://wordpress.org/support/users/jonbenwaa/)
 * (@jonbenwaa)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/getting-illegal-string-offset-classroom-error/#post-4252761)
 * Here’s my fix:
 * Go into the code and file the file called WcsOutputController.php- it will be
   under wp-content/plugins/weekly-class-schedule/controllers/
 * Next find this line of code (for me it’s line 11):
 *     ```
       $classroom = $attr['classroom'];
       ```
   
 * And add a line above it and below it so it’s inside a condition loop that looks
   like this:
 *     ```
       if ( isset($attr['classroom']) && ! empty($attr['classroom']) ) {
               $classroom = $attr['classroom'];
       }
       ```
   
 * Without digging too deep into the code on this plugin, I know this will work 
   because it was basically trying to set a classroom value to a variable when there
   was no classroom value.
 *  [jillc](https://wordpress.org/support/users/jillc/)
 * (@jillc)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/getting-illegal-string-offset-classroom-error/#post-4252766)
 * That not right jonbenwaa!
    You may have noticed on the instructions they suggested
   you could set layout attribute like this: [wcs layout=horizontal]. Therefore,[
   wcs layout=vertical] forces it to use the default vertical layout and happily
   removes the error message.
 *  [AthleteHI](https://wordpress.org/support/users/athletehi/)
 * (@athletehi)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/getting-illegal-string-offset-classroom-error/#post-4252769)
 * It is true that using [wcs layout=vertical] instead of just [wcs] removes the
   classroom error. However, it still leaves “holes” in the schedule. I have a black
   background on the page so it’s really obvious that something is still wrong.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Getting Illegal string offset 'classroom' error’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/weekly-class-schedule_e7e1ae.svg)
 * [Weekly Class Schedule](https://wordpress.org/plugins/weekly-class-schedule/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/weekly-class-schedule/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/weekly-class-schedule/)
 * [Active Topics](https://wordpress.org/support/plugin/weekly-class-schedule/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/weekly-class-schedule/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/weekly-class-schedule/reviews/)

 * 3 replies
 * 4 participants
 * Last reply from: [AthleteHI](https://wordpress.org/support/users/athletehi/)
 * Last activity: [12 years, 4 months ago](https://wordpress.org/support/topic/getting-illegal-string-offset-classroom-error/#post-4252769)
 * Status: not resolved