Buddypress invalid offset error while activating theme

Recently I tried my hands on Buddypress just to make myself familiar with this offering from WordPress providers.I was using WordPress 3.4.Installing Buddypress was very easy.It is just like any other plugin.After installation you will be prompted for Installation wizard.

The installation wizard is pretty simple.You will need to check check boxes applicable to your requirement and un check those not applicable.After making the changes you need to click on Save and Next.There are in total five screens on Buddypress installation wizard.

On the fourth screen you need to choose theme for your Buddypress installation.You can select default one or any compatible theme you have already installed.You can also select non compatible theme and later install the Buddypress template pack plugin.

I selected one non compatible theme and clicked on save next.On the page a warning message got displayed saying invalid offset error around line number 642.I am unable to recall exact message because it was 2-3 days back and I was too busy to note it down.But more or less if you get warning like this then proceed as follows.

  • Open the file bp-core-update.php.You can find this plugin at wp-content/plugins/buddypress/bp-core/admin folder.
  • Search for line mentioned below.This will appear around line number 642 in the file.
if ( !empty( $installed_themes[$current_theme]['Screenshot'] ) )
	$screenshot = trailingslashit( get_stylesheet_directory_uri() ) . $installed_themes[$current_theme]['Screenshot'];
  • Comment the lines and save the files.To comment the lines you can use //.So your modified code will become
//if ( !empty( $installed_themes[$current_theme]['Screenshot'] ) )
//    $screenshot = trailingslashit( get_stylesheet_directory_uri() ) . $installed_themes[$current_theme]    ['Screenshot'];

Now it is good to make these changes before starting the installation wizard just to be on safer side.The installation wizard is irreversible process meaning that you can not go back.

In case you have got this error and want to try for fresh installation once again you will need to clean up previous installation history else your installation will start from the point you left it.You can not remove the history by removing the plugin.It needs much involved steps so I decided to come up with another post dealing with this.

Leave a Comment