Title: Error previewing theme in admin
Last modified: October 2, 2023

---

# Error previewing theme in admin

 *  [Draky](https://wordpress.org/support/users/draky/)
 * (@draky)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/error-previewing-theme-in-admin/)
 * Hello.
 * I have downloaded this theme through my WP admin but when I try to preview it,
   it gives me PHP error about capabilities.php.
 * Here is the message :
 *     ```wp-block-code
       Fatal error: Uncaught Error: Call to undefined function wp_get_current_user() in /home/XXXXX/wp-includes/capabilities.php:877 Stack trace: #0 /home/XXXXX/wp-includes/theme-previews.php(17): current_user_can('switch_themes') #1 /home/XXXXX/wp-includes/class-wp-hook.php(310): wp_get_theme_preview_path('twentytwenty') #2 /home/XXXXX/wp-includes/plugin.php(205): WP_Hook->apply_filters('twentytwenty', Array) #3 /home/XXXXX/wp-includes/theme.php(317): apply_filters('template', 'twentytwenty') #4 /home/XXXXX/wp-includes/theme.php(328): get_template() #5 /home/XXXXX/wp-includes/l10n.php(1306): get_template_directory() #6 /home/XXXXX/wp-includes/l10n.php(1331): _load_textdomain_just_in_time('simple-lightbox') #7 /home/XXXXX/wp-includes/l10n.php(185): get_translations_for_domain('simple-lightbox') #8 /home/XXXXX/wp-includes/l10n.php(297): translate('Simple Lightbox', 'simple-lightbox') #9 /home/XXXXX/wp-content/plugins/simple-lightbox/main.php(27): __('Simple Lightbox', 'simple-lightbox') #10 /home/XXXXX/wp-settings.php(462): include_once('/XXXXX...') #11 /home/XXXXX/wp-config.php(98): require_once('/XXXXX...') #12 /home/XXXXX/wp-load.php(50): require_once('/XXXXX...') #13 /home/XXXXX/wp-admin/admin.php(34): require_once('/XXXXX...') #14 /home/XXXXX/wp-admin/site-editor.php(12): require_once('/XXXXX...') #15 {main} thrown in /home/XXXXX/wp-includes/capabilities.php on line 877
       ```
   
 * Any idea of the problem ?
 * Thanks.

Viewing 1 replies (of 1 total)

 *  [Velda](https://wordpress.org/support/users/supernovia/)
 * (@supernovia)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/error-previewing-theme-in-admin/#post-17094540)
 * Hey there [@draky](https://wordpress.org/support/users/draky/) – are you getting
   this error with other theme previews? You might try using [Health Check](https://wordpress.org/plugins/health-check/)
   to see if you get anything different when previewing without Simple Lightbox 
   active, since that plugin is mentioned in the error.

Viewing 1 replies (of 1 total)

The topic ‘Error previewing theme in admin’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/pixl/1.0.8/screenshot.png)
 * Pixl
 * [Support Threads](https://wordpress.org/support/theme/pixl/)
 * [Active Topics](https://wordpress.org/support/theme/pixl/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/pixl/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/pixl/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Velda](https://wordpress.org/support/users/supernovia/)
 * Last activity: [2 years, 8 months ago](https://wordpress.org/support/topic/error-previewing-theme-in-admin/#post-17094540)
 * Status: not resolved