Title: [Plugin: WP-Table Reloaded] PHP usage
Last modified: August 20, 2016

---

# [Plugin: WP-Table Reloaded] PHP usage

 *  [drizzle](https://wordpress.org/support/users/drizzle/)
 * (@drizzle)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-wp-table-reloaded-php-usage/)
 * Hi. I’d like to insert some photos into a table with some php that checks that
   the custom fields containing the links to the photos are not empty. I’m thinking
   of using Fancybox so that clicking on the image thumb opens the larger image.
 * Something like this:
 *     ```
       <?php $photo = get_post_meta($post->ID, 'large_photo', true); ?>
       <?php $thumb = get_post_meta($post->ID, 'small_photo', true); ?>
       <?php if (!empty($photo) && !empty($thumb)) {;?>
       <a class="single_image" href="<?php echo $photo; ?>"><img src="<?php echo $thumb; ?>" /></a>
       <?php }; ?>
       ```
   
 * But this isn’t working, and I’m not sure if it’s because of my php or that what
   I’m trying to do isn’t possible in the table.
 * Thanks for any thoughts.
 * [http://wordpress.org/extend/plugins/wp-table-reloaded/](http://wordpress.org/extend/plugins/wp-table-reloaded/)

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

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-wp-table-reloaded-php-usage/#post-2339780)
 * Hi,
 * are you using the PHP Extension for table cells ([http://tobias.baethge.com/2010/02/extension-5-how-to-use-php-in-table-cells/](http://tobias.baethge.com/2010/02/extension-5-how-to-use-php-in-table-cells/))
   for this?
 * Then you will first need to make the `$post` variable global, with something 
   like
 *     ```
       global $post;
       ```
   
 * before your code.
 * Regards,
    Tobias
 *  Thread Starter [drizzle](https://wordpress.org/support/users/drizzle/)
 * (@drizzle)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-wp-table-reloaded-php-usage/#post-2339803)
 * Thanks Tobias. I’ll get that setup. In the meantime I pulled the php code out
   of the table and inserted it into the page template, and it’s giving me an error
   on the line with the link. So once I figure that out, I’ll look into the extension.
   Thanks again.
 *  Thread Starter [drizzle](https://wordpress.org/support/users/drizzle/)
 * (@drizzle)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-wp-table-reloaded-php-usage/#post-2339805)
 * ….Oh, and I’m using this with the WordPress Post Tabs plugin also.
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-wp-table-reloaded-php-usage/#post-2339847)
 * Hi,
 * oh, yes. You have placed `;` after the braces `{` and `}`, but those are illegal
   there.
 * Regards,
    Tobias
 *  Thread Starter [drizzle](https://wordpress.org/support/users/drizzle/)
 * (@drizzle)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-wp-table-reloaded-php-usage/#post-2339863)
 * Where do I put: `global $post;` Thanks.
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-wp-table-reloaded-php-usage/#post-2339891)
 * Hi,
 * that should be the first line of your code, so before the `$photo = ...` line.
 * Regards,
    Tobias

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

The topic ‘[Plugin: WP-Table Reloaded] PHP usage’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-table-reloaded_f7dcd3.svg)
 * [WP-Table Reloaded](https://wordpress.org/plugins/wp-table-reloaded/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-table-reloaded/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-table-reloaded/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-table-reloaded/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-table-reloaded/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-table-reloaded/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-wp-table-reloaded-php-usage/#post-2339891)
 * Status: not resolved