Wednesday, November 9, 2022
HomeWordPress Developmentfeatures - Find out how to repair enqueue_styles error for a twenty-seventeen...

features – Find out how to repair enqueue_styles error for a twenty-seventeen childtheme


I’ve searched your web site however can’t discover and repair this error I get:

Discover: Perform wp_enqueue_style was referred to as <sturdy>incorrectly</sturdy>. Scripts and kinds shouldn't be registered or enqueued till the <code>wp_enqueue_scripts</code>, <code>admin_enqueue_scripts</code>, or <code>login_enqueue_scripts</code> hooks. This discover was triggered by the <code>editor-buttons</code> deal with. Please see <a href="https://wordpress.org/help/article/debugging-in-wordpress/">Debugging in WordPress</a> for extra data. (This message was added in model 3.3.0.) in /wp-includes/features.php on line 5835

In my features.php I’ve:

//from: https://kinsta.com/weblog/twenty-seventeen-theme/
// Additionally discovered: https://make.wordpress.org/coaching/handbook/lesson-plans/theme-school/child-themes/child-themes-twentyseventeen/
perform childtheme_enqueue_styles() {
  wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/fashion.css' );

  wp_enqueue_style( 'child-style',
    get_stylesheet_directory_uri() . '/fashion.css',
    array( 'parent-style' ),
    wp_get_theme()->get('Model')
  );
}
add_action( 'wp_enqueue_scripts', 'childtheme_enqueue_styles' );
 
 
 // Technique 2: Exclude a Class from WordPress Homepage Utilizing Code
 // As at: https://www.wpbeginner.com/wp-tutorials/how-to-exclude-a-category-from-your-wordpress-homepage/
 perform exclude_webapps_home( $question ) {
if ( $query->is_home ) {
$query->set( 'cat', '-49' ); // MUST use 'cat' for class and '-ID' for class ID
}
return $question;
}

add_filter( 'pre_get_posts', 'exclude_webapps_home' );

?>

What should I alter? Are you able to assist?
I’ve no plugins or messed in any other case with the editor-buttons.
I’m on WordPress 6.1

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments