Skip to content

Instantly share code, notes, and snippets.

View codeweberdotcom1's full-sized avatar

Codeweber codeweberdotcom1

View GitHub Profile
<?php get_header(); ?>
<main id="content-wrapper">
<section id="section-hero" class="has-img-background" >
<?php
get_template_part( 'templates/sections/home', 'hero' );
@codeweberdotcom1
codeweberdotcom1 / functions.php
Created December 6, 2020 11:08 — forked from Swapnildhanrale/functions.php
How to load astra fonts with Preload attribute
add_filter( 'astra_enable_default_fonts', 'temp_disable_astra_fonts' );
function temp_disable_astra_fonts( $load ) {
$load = false;
return $load;
}
add_action( 'wp_head', 'add_astra_fonts_preload', 1 );
function add_astra_fonts_preload() {
?>
<link rel="preload" href="<?php echo get_site_url(); ?>/wp-content/themes/astra/assets/fonts/astra.woff" as="font" crossorigin />
<link rel="preload" href="<?php echo get_site_url(); ?>/wp-content/themes/astra/assets/fonts/astra.ttf" as="font" crossorigin />