• Resolved lyounk09

    (@lyounk09)


    I was adding some code to my functions.php and I got this fatal error and now I can’t log back into my site to try and fix anything even if I knew how to. Any help on how to fix this?

    Fatal error: Call to undefined function addaction() in /home/content/p3pnexwpnas06_data02/42/2407342/html/wp-content/themes/virtue_premium/functions.php on line 54

Viewing 13 replies - 31 through 43 (of 43 total)
  • Thread Starter lyounk09

    (@lyounk09)

    Thank you so much questas_admin. I will be watching the videos here shortly – I am still a bit confused though about why my child theme is not showing the premium functionality — if I go into the premium theme and do a live preview the changes that I made a couple days ago are there correctly – they are not with the child theme I am using = here is an example. In the drop down after “about” the options are opening to the left in the child theme version – in the premium live preview it is opening to the right (a change that I made)

    David_G

    (@questas_admin)

    Leave the child theme running, and make the same change you made before to set the menu dropdown the way you want it.

    Thread Starter lyounk09

    (@lyounk09)

    One more thing and then I think I will be good – how can I tell if the child theme is taking on the details of the parent? The reason I am asking is that when I activated the parent theme days ago there was another set of menu options on the right that is not there with the active child theme. Also how do I go about creating a functions.php file for the child theme directory? I read in this link that it should not be a copy of the parent php file so I’m not sure how to get a copy or make one.

    I am reading the info about child themes as well. Thank you so much.

    David_G

    (@questas_admin)

    First of all, now that your site is back up and running, I suggest that you go to your GoDaddy Cpanel and use the backup utility and create a backup of your site. GoDaddy support personel will help you if you cannot figure it out. But it is easy to do and you should do it often.

    To create a Functions.php file for your child theme is easy. Use NOTEPAD on your computer to create a new file. Place the following code in that file. No white space before or after it. Any php code you need to add goes in the middle. Then save it AS functions.php (without capital letters) upload it to the child theme where the style.css file is located. DONT upload it to the Parent theme.

    <?php
    
    ?>
    Thread Starter lyounk09

    (@lyounk09)

    Thank you questa_admin. You been of the greatest help and I appreciate your patience in all of this. I am assuming that the white space in the middle is appropriate leaving room for any changes, correct? Stupid question here – but I copied the code just as you have it. There is no rows about it but there is white space between and the entire document at the end is there. Is that right?

    <?php

    ?>

    David_G

    (@questas_admin)

    As for how your theme is suppose to work, I suggest going to the forum that supports your theme.
    http://www.kadencethemes.com/support-forums/

    David_G

    (@questas_admin)

    No, white space means no blank spaces before <?php or after ?>

    Any php code you enter goes below the <?php line.

    You can use a double // to make a comment line also to tell you what that does for instance using your code from earlier.

    <?php
    
    // This is a comment line - WOOCOMMERCE code
    addaction( 'woocommercebeforecarttable', 'wooaddcontinueshoppingbuttontocart' );
    function wooaddcontinueshoppingbuttontocart() {
    $shoppageurl = getpermalink( woocommercegetpageid( 'shop' ) );
    echo '<div class="woocommerce-message">';
    echo ' Continue Shopping → Need some more products?';
    echo '</div>';
    }
    
    ?>
    Thread Starter lyounk09

    (@lyounk09)

    Got it. Thanks again. Greatly appreciated.

    David_G

    (@questas_admin)

    IF ever your add php code and the site goes down, you can use ftp to rename the functions.php file in your child theme to functions.bak and your site will go back up. THen you can fix the code. Remember that php code doesn’t like mistakes and will make your site go down as you have figured out. CSS coding in your style.css file isn’t so finicky, if you make a mistake there the site wont go down, the customization just wont work.
    Make backups of your php and css files as you go, then you have a good file to work from.

    Thread Starter lyounk09

    (@lyounk09)

    Awesome. This is definitely useful information. I’m assuming that I do this renaming of the functions.php file in the Filezilla app which I use correct? I would much prefer using the CSS coding but I have yet to find an to add the “continue shopping” to my cart – that’s why I did the function php thing – I should have know I was in trouble when that page came up – way over my head.

    David_G

    (@questas_admin)

    There is probably a problem with that code snippet, go to the woocommerce forum for help on that. But yes, if you need to change the name to get the site back up, you can do it in FTP.
    Here are a couple of excellent programs I use for FTP and EDITING you may want to check them out.

    http://www.coreftp.com/
    http://notepad-plus-plus.org/

    David_G

    (@questas_admin)

    I noticed you got your menus fixed

    David_G

    (@questas_admin)

    Please mark this RESOLVED

Viewing 13 replies - 31 through 43 (of 43 total)

The topic ‘Fatal Error’ is closed to new replies.