This file contains 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 | |
/** | |
* Function : add_page_template_body_class | |
* Description : Adds the current page template filename to the body classes. | |
* Author : Dan Walsh | |
* | |
* @param array $classes : The array of classes attached to the body element. | |
*/ | |
function add_page_template_body_class( $classes ) { | |
global $post; |
This file contains 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
// set your global speed | |
const speed = 50; | |
// original position | |
const x1 = 334; | |
const y1 = 644; | |
// new position | |
const x2 = 182; | |
const y2 = 598; |
This file contains 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 | |
/** | |
* Returns a human readable filesize, given a filesize in bytes. | |
* | |
* @param integer $bytes The filesize to convert in bytes. | |
* @param integer $decimals The number of decimal places to return. Default is 2. | |
* @return string | |
*/ | |
function get_human_filesize( $bytes, $decimals = 2 ) { | |
$size = array( 'B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB' ); |
This file contains 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 | |
// Deregister the 'category' taxonomy from the default 'post' post type. | |
add_action( | |
'init', | |
function () { | |
unregister_taxonomy_for_object_type( 'category', 'post' ); | |
} | |
); |
This file contains 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 | |
// Adds a custom PNG favicon the the wp-admin area of WordPress. | |
add_action( | |
'admin_head', | |
function () { | |
echo '<link rel="icon" type="image/png" sizes="16x16" href="' . get_template_directory_uri() . '/favicon.png">'; | |
} | |
); | |
// Adds a custom ICO favicon the the wp-admin area of WordPress. |
This file contains 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 | |
global $wp_query; | |
var_dump( $wp_query->query_vars ); |
This file contains 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 | |
// Add the 'Client/Company Name' field to General Settings. | |
add_filter( | |
'admin_init', | |
function () { | |
register_setting( | |
'general', | |
'namespace_client_name', | |
'esc_attr' | |
); |
This file contains 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 | |
/** | |
* Pagination template part. | |
* | |
* Injects the required classes to properly render accessible pagination buttons akin to the theme. Uses Bootstrap 4 and Fontawesome. | |
* | |
* @package WordPress | |
*/ | |
$paginate_classes = ' btn btn-primary btn-sm py-2 px-3 mx-1 '; |
This file contains 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
/** | |
* Import Bootstrap | |
*/ | |
@import "../../node_modules/bootstrap/scss/bootstrap"; | |
/** | |
* Callouts | |
*/ |
OlderNewer