This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@font-face { | |
font-family: 'Inter'; | |
font-style: normal; | |
font-weight: 300 700; | |
font-display: swap; | |
src: url(https://www.seopress.org/wp-content/themes/blackhat/assets/fonts/inter.woff2) format('woff2'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Preload resources | |
add_filter('wp_resource_hints', 'seopress_resource_hints', 10, 2); | |
function seopress_resource_hints($urls, $relation_type) | |
{ | |
if (wp_style_is('degular-font', 'queue') && 'preconnect' === $relation_type) { | |
$urls[] = array( | |
'href' => 'https://use.typekit.net', | |
'crossorigin', | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Async CSS | |
add_filter('style_loader_tag', 'seopress_add_stylesheet_attributes', 10, 2); | |
function seopress_add_stylesheet_attributes($html, $handle) | |
{ | |
$styles = array( | |
'fonts', | |
'degular-font', | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# BEGIN Cache | |
# Use UTF-8 encoding for anything served text/plain or text/html | |
AddDefaultCharset UTF-8 | |
# Force UTF-8 for a number of file formats | |
<IfModule mod_mime.c> | |
AddCharset UTF-8 .atom .css .js .json .rss .vtt .xml | |
</IfModule> | |
<IfModule mod_headers.c> | |
Header unset ETag | |
</IfModule> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sp_social_fv_creator($html) { | |
//do your stuff here | |
//<meta name="fediverse:creator" content="@[email protected]" /> | |
return $html; | |
} | |
add_filter('seopress_social_fv_creator', 'sp_social_fv_creator'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('seopress_sitemaps_html_post_date_format', 'sp_sitemaps_html_post_date_format'); | |
function sp_sitemaps_html_post_date_format($date_format) { | |
$date_format = 'j F Y'; | |
return $date_format; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('seopress_schemas_auto_product_json', 'sp_schemas_auto_product_json'); | |
function sp_schemas_auto_product_json($json) { | |
// Returns schema as an array with 'property' => 'value' | |
// Get the product offers | |
$offers = $json['offers']; | |
// Add sub-type MerchantReturnPolicy and deliveryTime to each offer | |
if (!empty($offers)) { | |
foreach ($offers as $key => $offer) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sp_titles_template_variables_array($array) { | |
$array[] = '%%_acf_options_my_field_name%%'; | |
$array[] = '%%_acf_options_my_field_name_2%%'; | |
return $array; | |
} | |
add_filter('seopress_titles_template_variables_array', 'sp_titles_template_variables_array'); | |
function sp_titles_template_replace_array($array) { | |
$array[] = esc_attr(wp_strip_all_tags(get_field('my_field_name', 'option'))); |