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 | |
/** | |
* Sort Posts by "last modified date" | |
* | |
*/ | |
add_filter('posts_orderby', 'b3m_order_posts_by_mod_date', 999); | |
function b3m_order_posts_by_mod_date($orderby) { | |
if ( is_archive() ) { |
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
<script> | |
var links = document.links; | |
for (var i = 0, linksLength = links.length; i < linksLength; i++) { | |
if (links[i].hostname != window.location.hostname && links[i].protocol != 'tel:' && links[i].protocol != 'mailto:' ) { | |
links[i].target = '_blank'; | |
links[i].rel = 'noopener noreferrer'; | |
} | |
} | |
</script> |
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 | |
/** | |
* | |
* Remove Contact Form 7 CSS stylesheet from all pages except where needed. | |
* | |
*/ | |
add_action('wp_print_styles', 'rrd_remove_cf7_css'); | |
function rrd_remove_cf7_css() { | |
if ( function_exists( 'wpcf7_enqueue_styles' ) ) { |
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 shown above. Copy the code shown below. | |
//* Customize Genesis search form label | |
add_filter( 'genesis_search_form_label', 'b3m_search_form_label' ); | |
function b3m_search_form_label ( $text ) { | |
return esc_attr( 'Enter your text here...' ); | |
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 | |
//* Enqueue FontAwesome. Note that the current version in the code is 4.5.0. Update as necessary. | |
//* https://codex.wordpress.org/Plugin_API/Action_Reference/wp_enqueue_scripts | |
//* https://fortawesome.github.io/Font-Awesome/icons/ | |
<?php | |
//* Do NOT include the opening php tag |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 | |
//* Add theme info box into WordPress Dashboard | |
add_action('wp_dashboard_setup', 'b3m_add_dashboard_widgets' ); | |
function b3m_add_dashboard_widgets() { | |
wp_add_dashboard_widget('wp_dashboard_widget', 'Theme Details', 'b3m_theme_info'); | |
} |
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 | |
//* Login Screen: Don't inform user which piece of credential was incorrect | |
add_filter ( 'login_errors', 'b3m_failed_login' ); | |
function b3m_failed_login () { | |
return 'The login information you have entered is incorrect. Please try again.'; | |
} |
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 | |
//* Login Screen: Set 'remember me' to be checked | |
add_action( 'init', 'b3m_login_checked_remember_me' ); | |
function b3m_login_checked_remember_me() { | |
add_filter( 'login_footer', 'b3m_rememberme_checked' ) | |
; | |
} |
NewerOlder