Archived topic
Child theme issue
1 reply · Started by Damon on May 25, 2018
Hi there,
I have about 3000 lines of CSS.
(1) I tried using a child theme, and everything seems to be working fine, but I'm getting the following error on the dash: GP Premium requires GeneratePress to be your active theme. Install now.
(2) It's my gravity forms CSS that's so big, and it only applies to a few pages. Can you suggest a better approach than a child theme? My Simple CSS file is about 700 lines. I hesitate pasting another 2000 lines into a single page Simple CSS though.
1. Simply having a child theme activated won't trigger that message. However, that message will trigger if the folder name or name of the parent theme has been changed.
You can always remove that message with this PHP:
remove_action( 'admin_notices', 'generate_premium_theme_information' );
2. Definitely don't add that much CSS to Simple CSS.
You can create a separate file for your contact page, then add it to that page only:
add_action( 'wp_enqueue_scripts', 'tu_add_child_scripts' );
function tu_add_child_scripts() {
if ( is_page( 'contact' ) ) {
wp_enqueue_style( 'my-contact', 'URL TO YOUR CONTACT CSS FILE' );
}
}