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
/** | |
* Example: Reverse ACF query | |
*/ | |
function dt_get_related_sport_icon_positive($post) | |
{ | |
$related_sport_icon_positive = null; | |
$sports_term_objects = get_the_terms($post, 'sport_category'); |
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 | |
/** | |
* Clean up wp_head() | |
*/ | |
remove_action('wp_head', 'feed_links_extra', 3); // Display the links to the extra feeds such as category feeds | |
remove_action('wp_head', 'feed_links', 2); // Display the links to the general feeds: Post and Comment Feed | |
remove_action('wp_head', 'rsd_link'); // Display the link to the Really Simple Discovery service endpoint, EditURI link | |
remove_action('wp_head', 'wlwmanifest_link'); // Display the link to the Windows Live Writer manifest file. |
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 | |
/** | |
* Meta boxes | |
*/ | |
// Move Rank Math meta box below ACF meta boxes | |
function dt_rankmath_post_metabox_priority() | |
{ | |
return 'low'; |
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
// Increase the maximum image width to be included in a ‘srcset’ attribute (default is 1600px) | |
function dt_max_srcset_image_width() | |
{ | |
return 2000; | |
} | |
// add_filter( 'max_srcset_image_width', 'dt_max_srcset_image_width', 10 , 2 ); |
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
// Filter the image sizes automatically generated when uploading an image. | |
function dt_remove_default_image_sizes($sizes) | |
{ | |
unset($sizes['thumbnail']); | |
// unset( $sizes['medium']); // medium image size is used by WP Media Library for thumbnails | |
unset($sizes['medium_large']); | |
unset($sizes['large']); | |
return $sizes; | |
} | |
// add_filter( 'intermediate_image_sizes_advanced', 'dt_remove_default_image_sizes' ); |
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
// ACF colour picker palette | |
acf.add_filter('color_picker_args', function( args, $field ){ | |
args.palettes = ['#000000', '#FFFFFF', '#FC4D00', '#6750AA', '#F2E9DB', '#DCD3E7'] | |
return args; | |
}); |
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 | |
/** | |
* Allowed blocks | |
* | |
* What blocks are allowed where | |
*/ | |
/** | |
* Allowed core and ACF blocks |
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 | |
/** | |
* Admin emails | |
*/ | |
function dt_disable_new_user_registation_email() { | |
remove_action('register_new_user', 'wp_send_new_user_notifications'); | |
remove_action('edit_user_created_user', 'wp_send_new_user_notifications', 10, 2); |
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 | |
/** | |
* Template Name: Sitemap | |
*/ | |
?> | |
<?php get_header(); ?> | |
<div class="site-map"> |