Editing functions.php in child theme crashes site after error
-
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: https://delicate-elegance.com/
I hope this all makes sense & thank you so so much in advance for your help!
Best wishes,
Katie
- The topic ‘Editing functions.php in child theme crashes site after error’ is closed to new replies.