Title: Theme problem after upgrading wordpress
Last modified: August 24, 2016

---

# Theme problem after upgrading wordpress

 *  [mbekezm](https://wordpress.org/support/users/mbekezm/)
 * (@mbekezm)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/theme-problem-after-upgrading-wordpress/)
 * Holah
 * I recently upgraded an old site (had not checked in a long while) to the latest
   version , upon doing so, the theme started showing the following errors :
 *     ```
       Warning: Missing argument 2 for wpdb::prepare(), called in /srv/users/apps/uer/public/wp-content/themes/theme/lib/theme-sidebars.php on line 62 and defined in /srv/users/apps/user/public/wp-includes/wp-db.php on line 1192
       ```
   
 * When i checked the theme-sidebars.php he lines around there are
 *     ```
       function celta_sidebars_creator() {
       	global $wpdb;
       	$widgetized_pages = $wpdb->get_col( $wpdb->prepare("SELECT DISTINCT meta_value FROM $wpdb->postmeta WHERE meta_key = celta_sidebar'" ) );
       	if( $widgetized_pages ){
       		foreach( $widgetized_pages as $w_page ){
       			$widget_id = strtolower( str_replace( ' ', '_', $w_page ) );
       			register_sidebar( array(
       				'name' => $w_page,
       				'id'   => 'celta_' . $widget_id,
       				'description'   => 'Drag your widgets into this area.',
       				'before_widget' => '<div id="%1$s" class="widget %2$s">',
       				'after_widget' => '</div>',
       				'before_title' => '<h3 class="widget-title">',
       				'after_title' => '</h3>'
       			));
       		}
       	}
       }
       ?>
       ```
   
 * What can i change in those lines to fix this ?

Viewing 1 replies (of 1 total)

 *  [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * (@vtxyzzy)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/theme-problem-after-upgrading-wordpress/#post-6115962)
 * Try changing this:
 *     ```
       $widgetized_pages = $wpdb->get_col( $wpdb->prepare("SELECT DISTINCT meta_value FROM $wpdb->postmeta WHERE meta_key = celta_sidebar'" ) );
       ```
   
 * to this:
 *     ```
       $widgetized_pages = $wpdb->get_col( $wpdb->prepare("SELECT DISTINCT meta_value FROM $wpdb->postmeta WHERE meta_key = %s", 'celta_sidebar' ) );
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Theme problem after upgrading wordpress’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * Last activity: [10 years, 10 months ago](https://wordpress.org/support/topic/theme-problem-after-upgrading-wordpress/#post-6115962)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
