Error using function_exists in child theme
-
Hello,
I’m trying to override the generate_get_media_query of theme-functions.php in the child theme functions.php:if ( ! function_exists( 'generate_get_media_query' ) ) { function generate_get_media_query( $name ) { $desktop = apply_filters( 'generate_desktop_media_query', '(min-width:1025px)' ); $tablet = apply_filters( 'generate_tablet_media_query', '(min-width: 769px) and (max-width: 1024px)' ); $mobile = apply_filters( 'generate_mobile_media_query', '(max-width:768px)' ); $mobile_menu = apply_filters( 'generate_mobile_menu_media_query', $mobile ); $queries = apply_filters( 'generate_media_queries', array( 'desktop' => $desktop, 'tablet' => $tablet, 'mobile' => $mobile, 'mobile-menu' => $mobile_menu, ) ); return $queries[ $name ]; } }
However, I keep getting the Fatal error: Cannot redeclare generate_get_media_query().
What am I doing wrong?
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Error using function_exists in child theme’ is closed to new replies.