Child Theme & Functions.php issue
-
I have spent Many hours trying to solve this before posting here. Time spent reading many pages & forum topics (with proper functions.php issues).
The problem: I have created a child theme of SoSimple v1.2 theme which works in WAMP – no issues in display, wp-sign-in, or known functionality issues. Uploaded my child-theme & source theme to a apache server – solved a few minor issues – one was MY my-style.css in the child theme folder was not recognized – to went to https://codex.wordpress.org/Child_Themes & created a functions.php with the below code in it (ONLY this code)& used:
<?php function theme_enqueue_styles() { $parent_style = 'parent-style'; wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' ); wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array( $parent_style ) ); } add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' ); ?>which worked & my-style.css worked fine – HOWEVER – this functions.php file has created a “white screen” when trying to sign in on the wp-admin.php login. Once the functions.php I created is renamed (or removed) from the directory (via FTP) login functionality is fine & I can sign in fine. However, now the my-style.css is not recognized until the function.php file is renamed to functions.php.
This was a trial & error process to narrow down the source of the issue – trying another source theme with the child theme, reinstalling WP, no plugins (only 1 used), & a dozen or so ways to enter the function.php code in the functions.php file.Besides any advice on what to try – can some PLEASE post an example of what the “Proper” php code in the child functions.php file would be to accomplished to recognize my “my-style.css” in the sosimple-child directory vs the “style.css” in the Source them directory.
In addition, this issue only occurs when using the child theme – and NO other “white pages” occur, even when saving or viewing changes, or any time – sign-in is fine when using a Source theme.
Thank You
D.
The topic ‘Child Theme & Functions.php issue’ is closed to new replies.