Title: admin/admin-functions.php Please help!
Last modified: August 21, 2016

---

# admin/admin-functions.php Please help!

 *  [Haremclothing](https://wordpress.org/support/users/haremclothing/)
 * (@haremclothing)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/adminadmin-functionsphp-please-help/)
 * Parse error: syntax error, unexpected ‘<‘ in /home/cdnspuqs/public_html/wp-content/
   themes/gameday/admin/admin-functions.php on line 7
 * >     ```
   >     <?php
   > 
   >     /*-----------------------------------------------------------------------------------*/
   >     /* Add default options after activation */
   >     /*-----------------------------------------------------------------------------------*/
   >     if (is_admin() && isset($_GET['activated'] ) && $pagenow == "themes.php?page=siteoptions" ) {
   >     	//Call action that sets
   >     	add_action('admin_head','tt_option_setup');
   >     }
   > 
   >     function tt_option_setup(){
   > 
   >     	//Update EMPTY options
   >     	$tt_array = array();
   >     	add_option('tt_options',$tt_array);
   > 
   >     	$template = get_option('tt_template');
   >     	$saved_options = get_option('tt_options');
   > 
   >     	foreach($template as $option) {
   >     		if($option['type'] != 'heading'){
   >     			$id = $option['id'];
   >     			$std = $option['std'];
   >     			$db_option = get_option($id);
   >     			if(empty($db_option)){
   >     				if(is_array($option['type'])) {
   >     					foreach($option['type'] as $child){
   >     						$c_id = $child['id'];
   >     						$c_std = $child['std'];
   >     						update_option($c_id,$c_std);
   >     						$tt_array[$c_id] = $c_std;
   >     					}
   >     				} else {
   >     					update_option($id,$std);
   >     					$tt_array[$id] = $std;
   >     				}
   >     			}
   >     			else { //So just store the old values over again.
   >     				$tt_array[$id] = $db_option;
   >     			}
   >     		}
   >     	}
   >     	update_option('tt_options',$tt_array);
   >     }
   > 
   >     /*-----------------------------------------------------------------------------------*/
   >     /* Admin Backend */
   >     /*-----------------------------------------------------------------------------------*/
   >     function siteoptions_admin_head() { ?>
   > 
   >     <script type="text/javascript">
   >     jQuery(function(){
   >     var message = '<p><strong>Activation Successful!</strong> This theme\'s settings are located under <a href="<?php echo admin_url('admin.php?page=siteoptions'); ?>">Appearance > Site Options</a>.</p>';
   >     jQuery('.themes-php #message2').html(message);
   >     });
   >     </script>
   > 
   >         <?php }
   > 
   >     add_action('admin_head', 'siteoptions_admin_head');
   >     ?>
   > 
   >     <?php
   > 
   >     /*-----------------------------------------------------------------------------------*/
   >     /* Add default options after activation */
   >     /*-----------------------------------------------------------------------------------*/
   > 
   >     }
   > 
   >     if (is_admin() && isset($_GET['activated'] ) && $pagenow == "themes.php?page=siteoptions" ) {
   >     	//Call action that sets
   >     	add_action('admin_head','tt_option_setup');
   >     }
   > 
   >     function tt_option_setup(){
   > 
   >     	//Update EMPTY options
   >     	$tt_array = array();
   >     	add_option('tt_options',$tt_array);
   > 
   >     	$template = get_option('tt_template');
   >     	$saved_options = get_option('tt_options');
   > 
   >     	foreach($template as $option) {
   >     		if($option['type'] != 'heading'){
   >     			$id = $option['id'];
   >     			$std = $option['std'];
   >     			$db_option = get_option($id);
   >     			if(empty($db_option)){
   >     				if(is_array($option['type'])) {
   >     					foreach($option['type'] as $child){
   >     						$c_id = $child['id'];
   >     						$c_std = $child['std'];
   >     						update_option($c_id,$c_std);
   >     						$tt_array[$c_id] = $c_std;
   >     					}
   >     				} else {
   >     					update_option($id,$std);
   >     					$tt_array[$id] = $std;
   >     				}
   >     			}
   >     			else { //So just store the old values over again.
   >     				$tt_array[$id] = $db_option;
   >     			}
   >     		}
   >     	}
   >     	update_option('tt_options',$tt_array);
   >     }
   > 
   >     /*-----------------------------------------------------------------------------------*/
   >     /* Admin Backend */
   >     /*-----------------------------------------------------------------------------------*/
   >     function siteoptions_admin_head() { ?>
   > 
   >     <script type="text/javascript">
   >     jQuery(function(){
   >     var message = '<p><strong>Activation Successful!</strong> This theme\'s settings are located under <a href="<?php echo admin_url('admin.php?page=siteoptions'); ?>">Appearance > Site Options</a>.</p>';
   >     jQuery('.themes-php #message2').html(message);
   >     });
   >     </script>
   > 
   >         <?php }
   > 
   >     add_action('admin_head', 'siteoptions_admin_head');
   >     ?>
   >     ```
   > 

Viewing 1 replies (of 1 total)

 *  Thread Starter [Haremclothing](https://wordpress.org/support/users/haremclothing/)
 * (@haremclothing)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/adminadmin-functionsphp-please-help/#post-5069630)
 * I did try to install a floating add on the sides, ofc i did save my work on a
   word doc, but something happen and i cant get it back on feet!

Viewing 1 replies (of 1 total)

The topic ‘admin/admin-functions.php Please help!’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [Haremclothing](https://wordpress.org/support/users/haremclothing/)
 * Last activity: [11 years, 11 months ago](https://wordpress.org/support/topic/adminadmin-functionsphp-please-help/#post-5069630)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
