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 | |
// Do not copy opening php tag | |
// Force Stupid IE to NOT use compatibility mode | |
add_filter( 'wp_headers', 'wsm_keep_ie_modern' ); | |
function wsm_keep_ie_modern( $headers ) { | |
if ( isset( $_SERVER['HTTP_USER_AGENT'] ) && ( strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE' ) !== false ) ) { | |
$headers['X-UA-Compatible'] = 'IE=edge,chrome=1'; | |
} | |
return $headers; |
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 | |
/** | |
* Check the current post to see what type of post it is. | |
* | |
* This will return true whenever a post is equal to a specified post type. | |
* It can be useful when making global changes for a particular post type. | |
* | |
* @param $post_types array or string the type of posts you're wanting to check. | |
* @return bool true if the current post type matches any of the checked types. |
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 | |
// Do NOT include the opening php tag above | |
add_filter('tiny_mce_before_init', 'tiny_mce_remove_unused_formats' ); | |
/* | |
* Modify TinyMCE editor to remove H1. | |
*/ | |
function tiny_mce_remove_unused_formats($init) { | |
// Add block format elements you want to show in dropdown | |
$init['block_formats'] = 'Paragraph=p;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Address=address;Pre=pre'; |
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
//* Put these in functions.php | |
/** | |
* Description: This redirects the failed login to the custom login page instead of default login page with a modified url | |
* @link ttp://wordpress.stackexchange.com/questions/110094/custom-login-redirects-to-wp-admin-on-wrong-password | |
**/ | |
add_action( 'wp_login_failed', 'prefix_front_end_login_fail' ); | |
function prefix_front_end_login_fail( $username ) { | |
// Getting URL of the login page |
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 | |
/** | |
* Get post image. | |
*/ | |
function wds_get_post_image( $size = 'thumbnail' ) { | |
// If featured image is present, use that | |
if ( has_post_thumbnail() ) { | |
return get_the_post_thumbnail( $size ); |
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 | |
/** | |
* Set Yoast SEO metabox priority to low. | |
*/ | |
function wds_client_move_yoastseo_metabox() { | |
return 'low'; | |
} | |
add_filter( 'wpseo_metabox_prio', 'wds_client_move_yoastseo_metabox' ); |
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
// Add genesis layout classes to the Block Editor. | |
// File lives in the theme's /js/ folder. | |
wp.domReady(function () { | |
yourTheme.updateLayoutClass(); | |
var layouts = document.querySelector(".genesis-layout-selector"); | |
if( layouts ) { | |
layouts.addEventListener("input", function (e) { | |
yourTheme.updateLayoutClass(); |