Wednesday, October 26, 2022
HomeWordPress Developmentwp enqueue model - How do I take away Google Fonts from...

wp enqueue model – How do I take away Google Fonts from a guardian theme?


I am utilizing the theme Pixgraphy and created a toddler theme. Due to latest modifications regarding knowledge safety within the EU, I now need to load Google Fonts regionally.

The guardian theme consists of the Google Fonts like this:

wp-content/themes/pixgraphy/inc/settings/pixgraphy-functions.php

/********* Including A number of Fonts ********************/
    $pixgraphy_googlefont = array();
    array_push( $pixgraphy_googlefont, 'Open+Sans:400,400italic,600');
    array_push( $pixgraphy_googlefont, 'Merriweather:400');
    $pixgraphy_googlefonts = implode("|", $pixgraphy_googlefont);
    wp_register_style( 'pixgraphy_google_fonts', '//fonts.googleapis.com/css?household='.$pixgraphy_googlefonts);
    wp_enqueue_style( 'pixgraphy_google_fonts' );
    if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
        wp_enqueue_script( 'comment-reply' );
    }

Now within the capabilities.php of the kid theme, I did this:

perform remove_google_fonts_stylesheet() {
    wp_dequeue_style( 'pixgraphy_google_fonts' );
}
add_action( 'wp_enqueue_scripts', 'remove_google_fonts_stylesheet', 100 );

From what I learn all over the place, this could work. However it does not, the Google Fonts are nonetheless loaded. That is the web site: http://werner-mueller-fotografie.de/

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments