Title: I see php code in sidebar
Last modified: August 20, 2016

---

# I see php code in sidebar

 *  [ciro.santilli](https://wordpress.org/support/users/cirosantilli/)
 * (@cirosantilli)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/i-see-php-code-in-sidebar/)
 * I see php code in the sidebar when I use recente changes widget:
 * 15) { $rc_number = 15; } else { $rc_number = $number; } if ( $content == ‘pages’){
   $rc_content_sql = “post_type = ‘page’ AND post_status = ‘publish'”; } else if(
   $content == ‘posts’ ) { $rc_content_sql = “post_type = ‘post’ AND post_status
   = ‘publish'”; } else { $rc_content_sql = “post_type = ‘page’ AND post_status 
   = ‘publish’ OR (post_type = ‘post’ AND post_status = ‘publish’)”; } $rc_exclude
   = preg_replace(‘/[^0-9,]/’, ”, $exclude); $rc_exclude_array = explode(‘,’, $rc_exclude);
   if ($exclude != ”) { $rc_number = $rc_number + count($rc_exclude_array); } global
   $wpdb; $rc_sql = “SELECT post_title, ID FROM “.$wpdb->posts.” WHERE “.$rc_content_sql.”
   ORDER BY post_modified DESC LIMIT “.$rc_number; $rc_output = $before_widget.$
   before_title.$rc_title.$after_title.’
 *  ‘; $RecentChanges = $wpdb->get_results($rc_sql); foreach ($RecentChanges as 
   $RecentChange) : if (in_array($RecentChange->ID,$rc_exclude_array)) { } else {
   $rc_url = get_permalink($RecentChange->ID); $rc_output .= ‘
    ‘.$RecentChange-
   >post_title.’ ‘.”\n”; } endforeach; $rc_output .= ‘
 * ‘.$after_widget; $wpdb->flush(); ?>

Viewing 1 replies (of 1 total)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/i-see-php-code-in-sidebar/#post-2272854)
 * the plugin code is using a php shorttag, and not all servers are set to understand
   this;
 * edit recent-changes-inc.php (in the plugin folder):
 *     ```
       <?
       if ($number < 0 || $number > 15) { $rc_number = 15; }
       ```
   
 * and change `<?` to `<?php`

Viewing 1 replies (of 1 total)

The topic ‘I see php code in sidebar’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/recent-changes.svg)
 * [Recent Changes](https://wordpress.org/plugins/recent-changes/)
 * [Support Threads](https://wordpress.org/support/plugin/recent-changes/)
 * [Active Topics](https://wordpress.org/support/plugin/recent-changes/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/recent-changes/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/recent-changes/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Michael](https://wordpress.org/support/users/alchymyth/)
 * Last activity: [14 years, 9 months ago](https://wordpress.org/support/topic/i-see-php-code-in-sidebar/#post-2272854)
 * Status: not resolved