Makeing my own custom theme and have an error in my php code

Hi I just started using WordPress and am new to web site developing in general, I have an syntax error in one of my files and I have run out of ideas to fix it. I will post the whole file code in the hope someone else has an idea on how to fix the error.

<?php

/*

@package shadowbanegamestheme

	==========================
		ADMIN PAGE
	==========================
*/

function shadowbane_add_admin_page() {
	
	//generate shadowbane admin page

	add_menu_page( 'Shadowbane Theme Options', 'Shadowbane', 'manage_options', 'aaron_shadowbane', 'shadowbane_theme_create_page', 'dashicons-admin-customizer', 110 );
	
	// generate shadowbane admin sub pages
	
add_submenu_page( 'aaron_shadowbane', 'Shadowbane Theme Options', 'General', 'manage_options', 'aaron_shadowbane', 'shadowbane_theme_create_page' );

add_submenu_page( 'aaron_shadowbane', 'Shadowbane CSS Options', 'custum css', 'manage_options', 'aaron_shadowbane_css', 'shadowbane_theme_settings_page' );
	//Activate Custom Settings
add_action( 'admin_int', 'shadowbane_custom_settings' );
	
}

add_action( 'admin_menu', 'shadowbane_add_admin_page' );

function shadowbane_custom_settings() {
	register_setting( 'shadowbane-settings-group', 'first_name');
	register_setting( 'shadowbane-settings-group', 'last_name' );
	
	add_settings_section( 'shadowbane-sidebar-options', 'Sidebar Options', 'shadowbanne_sidebar__options', "aaron_shadowbane' );
	add_settings_field( 'sidebar-name', 'First Name', 'shadowbane_sidebar_name', 'aaron_shadowbane 'shadowbane-sidebar-options');
	add_settings_field( 'sidebar-twitter', 'Twitter Handler', 'shadowbane_sidebar_twitter', 'aaron_shadowbane', 'shadowbane-sidebar-options');
}

function shadowbane_sidebar_name(){
		$firstName = esc_attr( get_option( 'first_name'));
	
	echo '<input type='text' name='first_name' value='.$firstName.' placeholder= 'First Name' />'; 

}



function shadowbane_theme_create_page() {
	//generation of admin page
	
		require_once( get_template_directory() . '/inc/template/shadowbane-admin.php' );
}

function shadowbane_theme_settings_page() {}

I forgot to include the whole error message. here it is:

Parse error: syntax error, unexpected end of file in D:\xampp\htdocs\shadowbanegames\wp-content\themes\shadowbanegames\inc\function-admin.php on line 54

First of all, put everything in triple tick marks so it's nice and neat:

```php
Blockofcode();
echo 'stuff';
```

echo '<input type='text' name='first_name' value='.$firstName.' placeholder= 'First Name' />';

This is the culprit, most likely. You're using single quotes so escape the string but the HTML attributes are also escaping the string. PHP doesn't know what to do with it because it's not being concatenated or anything

thanks, I now have another error in line 45 of the same file.

   function shadowbane_custom_settings() {
	register_setting( 'shadowbane-settings-group', 'first_name');
	register_setting( 'shadowbane-settings-group', 'last_name' );
	register_setting( 'shadowbane-settings-group', 'twitter_handler' );
	register_setting( 'shadowbane-settings-group', 'facebook_handler' );
	
	
	
	add_settings_section( 'shadowbane-sidebar-options', 'Sidebar Options', 'shadowbanne_sidebar__options', 'aaron_shadowbane' );
	
	add_settings_field( 'sidebar-name', 'Full Name', 'shadowbane_sidebar_name', 'aaron_shadowbane', 'shadowbane-sidebar-options');
	add_settings_field( 'sidebar-twitter', 'Twitter Handler', 'shadowbane_sidebar_twitter', 'aaron_shadowbane', 'shadowbane-sidebar-options');
	add_settings_field( 'sidebar-facebook_', 'facebook handler', 'shadowbane_sidebar_facebook', 'aaron_shadowbane', 'shadowbane-sidebar-options');
}

funcution shadowbane_sidebar_options() { 
	echo 'customize your sidebar Information';
}

The error I keep getting is in the lines above. The full error message is

Parse error: syntax error, unexpected 'shadowbane_sidebar_options' (T_STRING) in D:\xampp\htdocs\shadowbanegames\wp-content\themes\shadowbanegames\inc\function-admin.php on line 45

You misspelled function.

1 Like

Thanks I didn't catch that.

I edited your posts for the code formatting.