Where do I paste this code?
Thanks for taking the time to code this BTW 🙂 It means a lot to me.
You would put it where your other code was (after removing your old code that didn’t work).
🙁
Parse error: syntax error, unexpected ‘[‘, expecting ‘{‘ in /home2/greennin/public_html/dj-party-planner.com/wp-content/plugins/williams-custom-wp-login-plugin/william-custom-login.php on line 36
So where is the [ on line 36? There’s nothing like that in any of the code that I’ve given, so I can’t help with that.
You need to do some debugging yourself here. The error message tells you exactly what the problem is, and where you can find it. Use that information to go to that line, and fix what it says the problem is.
I tried exactly that. No avail.
Here is all the main code except for the CSS:
<?php
/*
function custom_login_css(){
echo ‘<link rel=”stylesheet” type=”text/css” href=”‘ . plugins_url( ‘/style.css’ , __FILE__ ) . ‘”/> ‘;
}
add_action (‘login_head’,’custom_login_css’);
add_filter(‘login_headerurl’, ‘custom_login_header_url’);
function custom_login_header_url($url){
return ‘http://titan-websites.com.com’;
}
add_filter(‘login_headertitle’, ‘custom_login_header_title’);
function custom_login_header_title($title){
return ‘Designed and Developed by Titan Websites’;
}
function register_my_custom_menu(){
add_menu_page( ‘Custom WP Login’, ‘Williams Custom WP Login Plugin’, ‘manage_options’, ‘custom_login’, ‘my_custom_menu_page_callback’, plugins_url( ‘logo.png’, __FILE__ ));
add_submenu_page( ‘custom_login’, ‘My Custom Submenu Page’, ‘My Custom Submenu Page’, ‘manage_options’, ‘custom_login_subpage’, ‘my_custom_submenu_page_callback’);
}
add_action( ‘admin_menu’, ‘register_my_custom_menu’ );
function my_custom_menu_page_callback( ) [
echo ‘<p>Main custom page</p>’;
}
function my_custom_submenu_page_callback( ) [
echo ‘<p>Sub custom page</p>’;
}
You should post code in backticks so that it formats corectly. 🙂
But I was sort of wrong, the error was in the code that I gave you. BUT if you can’t look at that line and see exactly what the problem is, then you are going to find it very hard to debug any issues in the future.
I can see straight away where the problem is. Look at this line:
function my_custom_menu_page_callback( ) [
Does that look like a valid function opening statement? It’s not. The [ there should be a { and that’s what it’s complaining about. I would hav eseen that if I had used my proper text editor too, but I wasn’t so I missed it as well.
So, this is a lesson… get a good text editor that shows syntax and highlites errors. There’s a lot out there that work, so find one that works for you, and it will help to solve a lot of these issues.
UPDATE:
After a bit of tinkering managed to get my site back live.
Problem was even though i had fixed the ‘[‘ my ftp did not correctly upload the new document. Restarted FileZilla works like a charm.
You Sir will defiantly be added as a contributor if\when I upload this plugin to the repository. You have been an immense help to me. No all I have to do is make some text boxes and user input areas.
I have another question. How come the image is broken?
Which image do you mean? I’m guessing the icon for the menu item?
If that’s the case then I’d suggest using Firebug (or your preferred browsers developer tools) to find out if it’s showing up, or isn’t there and see what the URL that it’s requesting is. You’ll see where the problem is that way.