SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Member
    Join Date
    Dec 2007
    Location
    NY, USA
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Adding theme broke WP [solved]

    Cant seem to find an answer to get me back in to my wp-admin. I added a them, apparently an incompatable one (tripleK2 I think..) and now I seem to be stuck. I cant view any of the WP pages, all I get is an error.

    Code:
    Fatal error: Cannot redeclare register_sidebar() 
    (previously declared in /home/fourn1/public_html/kaps/bs/wp-includes/widgets.php:36) 
    in /home/fourn1/public_html/kaps/bs/wp-content/themes/TripleK2/app/includes/sbm.php
     on line 27
    Can I just delete the theme or do I need to go back into the .php and make a correction?
    Are there any plug-ins or scripts that can help with this in the future? (I seem to remember a "swiss army knife" fix or something when I was using php nuke or one of those a while back..)

    jerry
    Last edited by jfg69; Dec 30, 2007 at 20:16.

  2. #2
    SitePoint Member
    Join Date
    Dec 2007
    Location
    In the south
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi there - I had that happen once, and the only thing I could think of to do was to go into FTP and delete the theme from my themes folder. When you do that, the blog reverts to the default theme and you're home free (at least in my case).

    It appears, from the code snippet you have above, that the problem is with a widget that you have from a previous theme (?) that's incompatible with the new theme? Unsure...but it seems plain that the new theme is the culprit.

    Good luck.
    2pencil

  3. #3
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    16,420
    Mentioned
    160 Post(s)
    Tagged
    1 Thread(s)

    theme

    As triplek2 is WordPress 2.1 compatible and you should be running ver. 2.3.2, I suggest you use a different theme.
    You should do 2 things
    First, delete the theme folder
    Then change the wp-options table so the fields "template" and "stylesheet" have the value of another theme.
    -- OR --
    Try hacking the /app/includes/smb.php file and hope for the best (most likely you'll just get a different error requiring further hacking).
    PHP Code:
    /*
    function register_sidebar($args = array()) {
        K2SBM::register_sidebar($args);
    }
    */ 
    EDIT: as 2pencil suggested, you may be lucky enough to not have to go into the database, if WP falls back to "default".

  4. #4
    SitePoint Member
    Join Date
    Dec 2007
    Location
    NY, USA
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, I'll give those a try and see what happens. The theme included the widgets, I believe- since I dont recall adding any myself.
    I guess an "emergency back door reset" would be a nice plug in to have, eh?

    jerry

  5. #5
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    16,420
    Mentioned
    160 Post(s)
    Tagged
    1 Thread(s)

    widgets

    Widgets are now part of the WordPress core files. The wp-includes/widgets.php file has
    PHP Code:
    function register_sidebar($args = array()) {
        global 
    $wp_registered_sidebars;

        if ( 
    is_string($args) )
            
    parse_str($args$args);
    ....... 
    Back in version 2.1, widgets were not part of the core, and there was no register_sidebar function. So there was no naming conflict with the theme at that time.

    If you really like the theme, you could try convincing the author to update it.

  6. #6
    SitePoint Member
    Join Date
    Dec 2007
    Location
    NY, USA
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Mittineague View Post
    As triplek2 is WordPress 2.1 compatible and you should be running ver. 2.3.2, I suggest you use a different theme.
    You should do 2 things
    First, delete the theme folder
    Then change the wp-options table so the fields "template" and "stylesheet" have the value of another theme.
    -- OR --
    Try hacking the /app/includes/smb.php file and hope for the best (most likely you'll just get a different error requiring further hacking).
    PHP Code:
    /*
    function register_sidebar($args = array()) {
        K2SBM::register_sidebar($args);
    }
    */ 
    EDIT: as 2pencil suggested, you may be lucky enough to not have to go into the database, if WP falls back to "default".
    Well, the hacks didnt work- I did get a bunch of different errors and commented those out as well, but just a never ending bunch of errors.

  7. #7
    SitePoint Member
    Join Date
    Dec 2007
    Location
    NY, USA
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Re-named the folder and it did in fact revert to default. Thanks folks!

    jerry

  8. #8
    SitePoint Zealot purplefdu's Avatar
    Join Date
    Jul 2007
    Location
    Maine, US
    Posts
    146
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Good to see there is a light at the end of the tunnel in the case I ever decide to go it on my own. The widget issue seems to be a rather bumpy road in the updating.
    Homeward Bound Puppy now with a store!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •