WooThemes Modding Series Part 1: Personalize the Theme Options
Posted on 27. Nov, 2009 by admin in Tutorials | 0 responses
In this part of the series, we will play around with the theme options. If you haven’t download the Rockstar theme, download it here. Let’s get started:
A look into the Theme Options files
All of the theme’s functions details (including files and locations) can be located under ‘functions.php‘:

So, since we are messing around with the theme options, the files we are going to modify are:
- functions/admin-interface.php: the theme options interface.
- includes/theme-options.php: the theme options items.
Change the Theme Options location
The first thing we are going to do is to remove the WooThemes’ branding from the theme options (because you probably don’t want your client to see it).

1. Go to functions/admin-interface.php.
2. On line 93, replace ‘add_object_page‘ with ‘add_theme_page‘. Replace ‘Page Title‘ and ‘$themename‘ with ‘Theme Options‘.
3. On line 97, replace ‘add_menu_page‘ with ‘add_theme_page‘. Replace ‘Page Title‘ and ‘$themename‘ with ‘Theme Options‘.
4. The changes will place the theme options menu under ‘Appearance’ tab, instead of creating its own tab under the WordPress administrative area. Your code should look like this now:
91 92 93 94 95 96 97 98 | if(function_exists(add_object_page)) { add_theme_page ('Theme Options', 'Theme Options', 8,'woothemes', 'woothemes_page', get_bloginfo('template_url'). '/functions/images/woo-icon.png'); } else { add_theme_page ('Theme Options', 'Theme Options', 8,'woothemes_home', 'woothemes_page', get_bloginfo('template_url'). '/functions/images/woo-icon.png'); } |
To read more about adding menu to the administrative area, visit this WordPress documentation page.
Change the Theme Name
For the backend, the theme name is stored under a variable called ‘$themename’. To change it:
1. Go to includes/theme-options.php.
2. On line 5, replace ‘Rockstar‘ to ‘Moviestar‘ (or whatever name you would like to call your theme).
3. If you refresh your theme options page, you should see that it’s updated.

Add some finishing touch
We are not completely satisfy yet. There are two more things we would want to change: the icon and the annoying ‘Stuck on these options?’ on the theme options page.
1. Go back to the file functions/admin-interface.php.
2. On line 122, replace ‘woo-icon’ with ‘icon-themes’. That should display a default theme icon.
3. Remove the whole line 124. That should cover the whole #info div.
Your theme options page should look like this now.

Next up. Part 2: Declutter – remove stuff we don’t need.



Recent Comments