Support » Plugin: Childify Me » Editing functions.php in child theme crashes site after error

  • Resolved dudleyks

    (@dudleyks)



    Hi!

    I really hope I am posting this in the right place… 🙂

    I was trying to fix a different issue & accidentally posted some code that should have gone in the .css file in the function.php instead (I know – duh…). I then contacted Bluehost who renamed the child theme for me which put my site back online & got me back into my WordPress dashboard.

    I then changed to parent theme, deleted the child theme and uninstalled Childify Me. After this, I downloaded & installed Childify Me again, created and activated a new child theme & put in the code I had without the line which I had put in by mistake.

    The .css file updated without problem, but when I added the function.php code it crashed again, even without the line of code.
    Here is what I added into the function.php of the child theme:

    <?php
    /* Write your awesome functions below */
    add_filter( 'loop_shop_per_page', create_function( '$cols', 'return 24;' ), 20 );
    
    /****Get rid of WooCommerce related products*****/
    remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );

    This code was working before so I’m not sure why it crashed the site? Bluehost got the site back up for me (again) but since then I am just using the Customizr parent theme & haven’t done anything with Childify Me.

    I’m not sure if the problem is in the code, the Customizr theme, or Childify Me… or even something else entirely, but I would really like to get my site back to normal with the CSS & functions alterations I had before my stupid mistake.

    Theme, WordPress & plugins are all up to date. I don’t have FTP access to my site. My site is: http://delicate-elegance.com/

    I hope this all makes sense & thank you so so much in advance for your help!

    Best wishes,

    Katie

    https://wordpress.org/plugins/childify-me/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Rocco Aliberti

    (@d4z_c0nf)

    Hello Katie.
    I’m sorry but this looks something which depends mostly on the way you changed the child-theme not by the child-theme itself.
    I explain, a child-theme itself is something stupid, it has no computational logic until you fill it with some function (its functions.php it’s loaded by wordpress itself once you specify an installed theme’s “name” as parent theme in the Template field of its style.css).
    Also, consider that this plugin doesn’t do anything more that:
    1) creating a directory with a specified name
    2) creating a functions.php file in it with the php start tag <?php and a comment line
    3) creating a style.css which points to the parent theme (Template attribute)
    Once done, this plugin doesn’t do anything more, you can even disable it 🙂
    So basically it’s highly improbable that this plugin can cause the issue, as it doesn’t cause the issue before, right?
    Sorry cannot help then ..
    (FIY I just re-tested it creating a new child-theme and pasting your code).

    Also the content of your child-theme functions.php (your style.css cannot break the site) doesn’t look to have any issue (but I just tested it in my child-theme and it’s fine).
    I’m sorry but the fact that you don’t have any type of direct access on your server (ftp/cPanel) will make pretty impossible for anyone (theme or woocommerce – as the two functions you have in the child theme area bout it – developers included) to debug your issue 🙁

    If you get a direct access you should – or your hosting company can do that for you you can ask them to – enable WP_DEBUG which will allow php to print error message so you can really see what’s happening.

    Hope this helps and you can solve it.

    Best regards.

    Rocco

    Hi Rocco,
    Thanks so much for your help (once again!). My site is back up and running again and I have FTP access now too! Childify Me & Customizr both reinstalled & working perfectly, despite my previous idiocy 😉
    I hope the problem is all solved now, but I need to learn about how to use FTP & Filezilla I guess, so I can work out how to solve this for myself in the future! 🙂
    Thanks again & sorry for posting in the wrong place!
    Katie

    Plugin Author Rocco Aliberti

    (@d4z_c0nf)

    Hello Katie,
    I’m glad to hear that.
    Don’t worry things like that happen, they happen to all of us 😀
    I couldn’t work without a direct server access 😉

    No need to be sorry for posting in the wrong place, sometimes is hard to understand what’s the right place, also ’cause when we don’t know what’s happening we cannot know who’s the culprit 😀

    Thanks for the feedback and happy websiting.

    Bests.

    Rocco

    That makes me feel better 🙂 Just gotta keep learning!
    Thanks again Rocco 😀
    Katie

    Plugin Author Rocco Aliberti

    (@d4z_c0nf)

    😀
    That’s the truth! 😀

    You’re welcome Katie.

    Rocco

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Editing functions.php in child theme crashes site after error’ is closed to new replies.