• dpskipper

    (@dpskipper)


    I am currently making a plugin that changes the default WP login page.
    Currently it is in very early stages. To change the WP logo on the login page, one has to do it inside the code. Could someone help me/give me required code to add some settings for the plugin. I want to have a box where users can add images from the media center and the plugin uses that as the image to use for the login screen. I would just like some help coding the settings area of the plugin. If you help me/give me some code that works, I would be happy to add you to the list of authors for the plugin.
    Many Thanks,
    William

Viewing 11 replies - 16 through 26 (of 26 total)
  • Thread Starter dpskipper

    (@dpskipper)

    Where do I paste this code?
    Thanks for taking the time to code this BTW 🙂 It means a lot to me.

    catacaustic

    (@catacaustic)

    You would put it where your other code was (after removing your old code that didn’t work).

    Thread Starter dpskipper

    (@dpskipper)

    🙁
    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

    catacaustic

    (@catacaustic)

    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.

    Thread Starter dpskipper

    (@dpskipper)

    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&#8217;;
    }
    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>’;
    }

    catacaustic

    (@catacaustic)

    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.

    Thread Starter dpskipper

    (@dpskipper)

    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.

    Thread Starter dpskipper

    (@dpskipper)

    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.

    Thread Starter dpskipper

    (@dpskipper)

    I have another question. How come the image is broken?

    catacaustic

    (@catacaustic)

    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.

    Thread Starter dpskipper

    (@dpskipper)

    Ok

Viewing 11 replies - 16 through 26 (of 26 total)

The topic ‘Plugin Code Question’ is closed to new replies.