Fatal error: Cannot redeclare directory_theme_paginate()

This topic contains 10 replies, has 3 voices, and was last updated by  Rich Harris 5 years, 6 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #454069

    Rich Harris
    Expired Member
    Post count: 37

    Hi.
    After updating Directory Starter, I get this message:
    Fatal error: Cannot redeclare directory_theme_paginate() (previously declared in /home/montclai/public_html/wp-content/themes/insomnia-mbid/lib/utils.php:3) in /home/montclai/public_html/wp-content/themes/directory-starter/lib/utils.php on line 20

    I even attempted to replace the updated files with my original version via php, no change. It was literally working fine a few minutes ago.

    Credentials to follow…

    #454070

    Rich Harris
    Expired Member
    Post count: 37
    This reply has been marked as private.
    #454071

    Rich Harris
    Expired Member
    Post count: 37

    I did try disabling all plugins, but no change at all. If I disable the file mentioned in the error, or just the one line, the error proceeds until I empty the child-theme’s version of the file, and then the error moves to the next file. Without the utils.php file in the child theme, I get an error warning that I need the file.

    This is disturbing and frightening. Please help.

    #454072

    Rich Harris
    Expired Member
    Post count: 37

    Finally, disabling my child theme fixes the error but leaves me childless. Sorry for the many posts.

    #454088

    Kor
    Moderator
    Post count: 16516

    Hi Rich,

    Thanks for your post. I’ve just checked your Website and I noticed that you’ve already switched to a ‘Twenty Seventeen’ child theme, could you replicate the issue so that we could check on it?

    Thanks!

    #454089

    Rich Harris
    Expired Member
    Post count: 37

    I thought you guys did that, since I see the 2017 theme became active a few hours after I left the office. If you check now, you can see what happens if I activate my child theme.
    https://montclaircenter.com/

    #454090

    Rich Harris
    Expired Member
    Post count: 37

    I can disable the theme via cPanel if you need. Thanks again.

    #454115

    Rich Harris
    Expired Member
    Post count: 37

    Okay. After reverting to Directory-Starter 1.1.5, I removed a section of code in the child theme’s functions.php which seems to have fixed much of the site. Here is the removed code:
    // Define the version number for quick access
    if (!defined(‘DIRECTORY_STARTER_VER’)) define(‘DIRECTORY_STARTER_VER’, ‘1.1.5’);

    require_once(‘lib/utils.php’); // Utility functions goes here
    require_once(‘lib/config.php’); // Configuration goes here
    require_once(‘lib/init.php’); // Theme setup functions goes here
    require_once(‘lib/cleanup.php’); // Cleanup functions goes here
    require_once(‘lib/scripts.php’); // CSS and JS includes goes here
    require_once(‘lib/nav.php’); // Nav menu functions goes here
    require_once(‘lib/sidebars.php’); // Register your sidebars here
    require_once(‘lib/widgets.php’); // Widget functions goes here
    require_once(‘lib/comments.php’); // Comments functions goes here
    require_once(‘lib/entrymeta.php’); // Entry meta functions goes here
    require_once(‘lib/custom.php’); // Any custom functions goes here
    require_once(‘lib/gd.php’); // GeoDirectory functions goes here
    require_once(‘lib/admin/customizer.php’); // Customizer settings
    require_once(‘lib/styles.php’); // CSS generated by customizer
    require_once(‘lib/dummy.php’); // Dummy post functions goes here

    Leaving any “require” line breaks the site. Without them, the search function of the directory works, but my category pages are crazy. i.e.:
    Looks wrong: https://montclaircenter.com/apparel-accessories/apparel-accessories/
    Should look like: https://montclaircenter.com/?geodir_search=1&stype=gd_shopping&s=+&snear=&sgd_shoppingcategory%5B%5D=&sgeo_lat=&sgeo_lon=

    I’d really appreciate it if you’d help me find a fix or how to revert this issue. I haven’t completely checked over the rest of the site yet, but so far i might be able to redirect all category page links to similar searches as a workaround (hopefully you’ve got something better). I still want to perform the theme update and soon the WP 5.0, but stable first.

    Thanks again for the help, any advice here would be great.

    #454122

    Kor
    Moderator
    Post count: 16516

    Hi Rich,

    Thanks for your reply. I will forward this to a developer and he will assist you further with this.

    Thanks!

    #454129

    Patrik
    Moderator
    Post count: 1971

    Hi,

    You don’t need that lib folder in your child theme. Can you please let us know why you have added it in the child so we can remove if you don’t need it? That folder is already in parent theme and not needed in the child theme. I have disabled the GD setting Design->Listings->Listing left section which fixed the sidebar issue on the category page.

    Regards,
    Patrik

    #454277

    Rich Harris
    Expired Member
    Post count: 37

    Wow. Amazing. Thank you. I’m not sure why the lib folder was there, I was either following a tutorial or copying someone else’s install. Either way, it wasn’t something I fully understood.

    I guess the upgrading and rolling back of the theme put the ‘listing left’ setting on – or I was overriding it before. In any case, I am much more equipped to deploy the update now.

    Thanks again.

Viewing 11 posts - 1 through 11 (of 11 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket