Title: Help adding columns
Last modified: September 28, 2016

---

# Help adding columns

 *  Resolved [nflowers1228](https://wordpress.org/support/users/nflowers1228/)
 * (@nflowers1228)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/some-help-with-customizing/)
 * I have made quite a bit of progress updating the meeting list page, however, 
   when I try to add columns, the Table Head shows up but not the column with data.
 * [http://www.ceahow.org/wp/meetings/](http://www.ceahow.org/wp/meetings/)
 * I’m trying to add the state as a separate TH but that didn’t work although when
   I added the code below, the city and state show up in the same column. Also Contact
   info is not showing up in a separate column. What am I missing?
 * <td class=”state” data-sort=”<?php echo sanitize_title($meeting[‘state’]) . ‘-‘.
   $sort_time?>”>
    <?php echo $meeting[‘state’]?> </td>
    -  This topic was modified 9 years, 7 months ago by [nflowers1228](https://wordpress.org/support/users/nflowers1228/).

Viewing 1 replies (of 1 total)

 *  [meetingguide](https://wordpress.org/support/users/meetingguide/)
 * (@meetingguide)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/some-help-with-customizing/#post-8232334)
 * Actually as of 2.5.3, state is no longer a field in the database. We’re just 
   storing the formatted address, eg `123 Main Street, Anytown, OK 12345, USA`. 
   Having it broken up into a bunch of individual fields on the backend creates 
   a more burdensome system, and doesn’t help with international addresses. Plus
   the new way is faster on many systems.
 * If I were you in this situation, I’d write a custom function to parse the state
   from the formatted address. Here’s one of the top of my head that I haven’t tested
   at all:
 *     ```
       function format_state($address) {
         $parts = explode(' ', $address);
         $count = count($parts);
         if (($parts[$count-1] == 'USA') && (strlen($parts[$count-3]) == 2)) {
           return $parts[$count-3];
         }
         return '';
       }
       ```
   
 * Then in your table:
 * `<?php echo format_state($meeting['formatted_address'])?>`
 * Good luck!

Viewing 1 replies (of 1 total)

The topic ‘Help adding columns’ is closed to new replies.

 * ![](https://ps.w.org/12-step-meeting-list/assets/icon-256x256.png?rev=2233591)
 * [12 Step Meeting List](https://wordpress.org/plugins/12-step-meeting-list/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/12-step-meeting-list/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/12-step-meeting-list/)
 * [Active Topics](https://wordpress.org/support/plugin/12-step-meeting-list/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/12-step-meeting-list/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/12-step-meeting-list/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [meetingguide](https://wordpress.org/support/users/meetingguide/)
 * Last activity: [9 years, 7 months ago](https://wordpress.org/support/topic/some-help-with-customizing/#post-8232334)
 * Status: resolved