Title: Theme activation throws errors
Last modified: November 25, 2016

---

# Theme activation throws errors

 *  [crcderek](https://wordpress.org/support/users/crcderek/)
 * (@crcderek)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/theme-activation-throws-errors/)
 * Hi,
 * i created a theme using underscores as a base theme and everything was fine until
   today when I started getting errors on the ‘All Posts’ and ‘All Pages’ pages (
   only those two pages)
 * Error on the page show above the right column above all listed posts and pages
   and churns out the same errors about a dozen times:
 * Warning: preg_match(): Unknown modifier ‘d’ {…}/wp-includes/class-wp.php on line
   231
    Warning: preg_match(): Unknown modifier ‘d’ {…}/wp-includes/class-wp.php
   on line 232
 * Which points to:
 *     ```
       if ( preg_match("#^$match#", $request_match, $matches) ||
           preg_match("#^$match#", urldecode($request_match), $matches) ) {
       ```
   
 * At the time I was installing and configuring some plugins:
    Adminimize Client
   Dash
 * So assuming it might be the plugins I deactivated and uninstalled them but the
   error still showed.
    I then assumed it maybe corrupt data in the db so restored
   the db to a known working backup but still nothing. I then tried activating a
   different theme and again nothing the error persists.
 * **Now all that said I decided to do an isolated install:**
    I installed the theme
   on another server thinking it may be a server issue and noticed the issue has
   to be with my theme, as it starts when I activate it but even if I deactivate
   it and go back to the original default theme the error stays..
 * Any ideas?
 * Currently taken everything offline and will be starting a fresh install in the
   morning on the original server but any pointers to what may be causing this error
   and how to fix will help me a lot as I’m now looking at having to pull older 
   versions of the theme from git and test each until I find at which point it breaks
   🙁

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

 *  Thread Starter [crcderek](https://wordpress.org/support/users/crcderek/)
 * (@crcderek)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/theme-activation-throws-errors/#post-8483092)
 * Update: Did a fresh install with a previous version of my theme and this is the
   exact error I’m getting repeated 19 times.
 *     ```
       Warning: preg_match(): Unknown modifier 'b' in /var/sites/c/<domain>/public_html/wp-includes/class-wp.php on line 230
   
       Warning: preg_match(): Unknown modifier 'b' in /var/sites/c/<domain>/public_html/wp-includes/class-wp.php on line 231
       ```
   
 *  Thread Starter [crcderek](https://wordpress.org/support/users/crcderek/)
 * (@crcderek)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/theme-activation-throws-errors/#post-8483203)
 * Update:
 * Think I have narrowed the issue down to this WP action in my theme functions.
   php file that i added to force pages to autoscroll to a section on the blog page(
   so the header of the page is above the page load area):
 *     ```
       /**
        * force set link structure to include #blog
        */
       function smartest_set_permalinks() 
       {
           global $wp_rewrite;
           $wp_rewrite->set_permalink_structure( '/%category%/%postname%/#blog' );
       }
       add_action( 'init', 'smartest_set_permalinks' );
       ```
   
 * This was working fine until yesterday (Friday 25th November, 2016).
    Whether 
   installing plugins stirred something I don’t know but I am now on a clean install
   of WP with a fresh DB and this function instantly breaks the ‘All Posts’ and ‘
   All Pages’ pages once my theme in activated. Even if I load a new default theme
   it stays broken so assuming actions are stored in a config that need resetting?
 * Anyway unless someone can see a fix to make this function work as I intended 
   I’m removing it and probably going to do the functionality with jQuery instead.
 * Hope this helps someone else troubleshoot similar issues.
    -  This reply was modified 9 years, 5 months ago by [crcderek](https://wordpress.org/support/users/crcderek/).

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

The topic ‘Theme activation throws errors’ is closed to new replies.

 * 2 replies
 * 1 participant
 * Last reply from: [crcderek](https://wordpress.org/support/users/crcderek/)
 * Last activity: [9 years, 5 months ago](https://wordpress.org/support/topic/theme-activation-throws-errors/#post-8483203)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
