• Resolved jgold723

    (@jgold723)


    I’m trying to create a working test copy of a site in a subdirectory of my current site.

    I have copied the files and database, but when I try to load the site, I get the error below and I don’t completely understand what the error means. I’m hoping someone here can help. The error is:

    Fatal error: Call to undefined function add_action() in /nfs/c04/h03/mnt/181475/domains/thesummitproject.org/html/site/wp-settings.php on line 6

    Line 6 in wp-settings is:
    add_action( ‘wp_head’, ‘wp_no_robots’ );

    1) What is undefined: the “add_action” function? or the actual action “wp_no_robots”
    2) If it is “add_action”, where is that found?

    I’m guessing I may have missed a file(s) when I copied the site, but I can’t track it down from this error.

    Thanks!

    • This topic was modified 7 years, 7 months ago by jgold723.

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    I’m guessing I may have missed a file(s) when I copied the site, but I can’t track it down from this error.

    That’s what I guess, too. You’re missing one or more core wordpress files or your subdirectory setup is incorrect.

    It is looking like there is a function probably defined in functions.php or an include that is missing it’s definition.

    Usually you use add_action(‘where_to_add’ , ‘function_name’);
    and the either directly before or after that you would define the function:

    function function_name() {
    some actions here
    }

    Thread Starter jgold723

    (@jgold723)

    Thanks. I’m thinking it might be a path issue (because I’ve copied the site into a subdirectory), but I can’t see anywhere a file path comes into play. From what I an tell, the files that contain the functions are present in the subdirectory.

    Just to test, I did a clean install of WordPress into another subdirectory and that works fine.

    Is the “new” site using the same DB?
    Did you just copy the files into subdir or did you move it with a backup/restore?

    Thread Starter jgold723

    (@jgold723)

    The “New” site is using a separate database. I copied all the files in the html directory into my “site” subdirectory. Then I exported the database, created a new database and imported the database into that. Then I modified the “site” wp-config file to use the new database.

    The process has been very cumbersome because it’s a fairly mature/large site and I haven’t been able to use my usual tools (FTP and phpMyAdmin) because of the size. I’ve been doing everything by SSH command line (copying files and importing the DB).

    I’m still working on the assumption that the copy I made is somehow incomplete and my next step is to recopy the html directory. But I’m very open to any suggestions as to other places to look.

    FWIW — I do know WP can be installed in a subdirectory on this host (MediaTemple) – -I did a fresh WP install just to check that and it works fine.

    I suggest using Akeeba Backup WP from Akeebabackup.com and the accompanying Kickstart.

    Akeeba backup will take an exact close of your site and db.
    You copy the site.jpa file from the Akeeba folder and the kickstart.php file to your desired subdirectory and run kickstart.

    it will decompress the site files, copy the database to the new one you created and change all urls in the site to reflect it’s new home.

    log into admin, re-save permalinks and menus and you are done!

    Thread Starter jgold723

    (@jgold723)

    Thank you very much – this seems like a workable solution.

    Thread Starter jgold723

    (@jgold723)

    Circling back to let you know that this solution worked! I ended up using Updraft Plus because I’m more familiar with that that, but the solution (restoring from a backup) worked quite well. Thank you again for your help — it’s very much appreciated!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘What does “Call to Undefined Function” mean?’ is closed to new replies.