# Upgrading legacy themes

{% hint style="danger" %}
**Please note:** This page is under construction and has not been finished yet.
{% endhint %}

## Introduction

Themes developed for v1.x of e107 will continue to work using v2.x. However, to get the most out of v2.x, it is recommended to make the following changes to bring your theme up to date with the new v2.x standards.

## theme.php

* Replace **$HEADER** and **$FOOTER** with **$HEADER\['default']** and **$FOOTER\['default']**
* Replace any occurrences of **$CUSTOMHEADER** and **$CUSTOMFOOTER** with **$HEADER\['custom']** and **$FOOTER\['custom']**
* If your theme contains links to external social media pages such as Facebook, Twitter or YouTube, use the core definitions for them. ie. **XURL\_FACEBOOK**, **XURL\_TWITTER**, **XURL\_YOUTUBE.**&#x20;
* Remove any reference to **$CUSTOMPAGES** and place them inside [**theme.xml**](https://devguide.e107.org/installation-and-configuration#theme-xml) in the [layouts](https://devguide.e107.org/installation-and-configuration#layout-section) section.&#x20;

```markup
<layout name='custom' title='Custom Pages'>
	<custompages>FRONTPAGE</custompages>
	<custompages>/forum/</custompages>
</layout>
```

* If you have used index.php in your **$CUSTOMPAGES** list, use **FRONTPAGE** instead (see above)
* The function **theme\_head()** has been deprecated. Instead, use either [e107::css()](https://devguide.e107.org/classes-and-methods/css) or [e107::js()](https://devguide.e107.org/classes-and-methods/javascript) to include what you require in the header. (see bootstrap or other new core theme for examples)
* **Shortcodes** need to be set to **UPPERCASE** in all occurrences in your [theme.php](https://devguide.e107.org/layout-and-templates#theme-php) file. (`$register[]` and everywhere else in [theme.php](https://devguide.e107.org/layout-and-templates#theme-php))

## Theme shortcodes

{% hint style="info" %}
**TIP:** As of e107 v2.x, you no longer need separate `xxxxxx.sc` files inside your theme's folder. You can now include all your theme-specific shortcodes in a single file called[**`theme_shortcodes.php`**](https://devguide.e107.org/theme-shortcodes#theme_shortcodes-php).&#x20;
{% endhint %}

Read more on theme shortcodes here:

{% content-ref url="theme-shortcodes" %}
[theme-shortcodes](https://devguide.e107.org/theme-development/theme-shortcodes)
{% endcontent-ref %}
