View posts-orderby-modified-date.php
<?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() ) {
View GTM-LinkOpener.js
<script>
var links = document.links;
for (var i = 0, linksLength = links.length; i < linksLength; i++) {
if (links[i].hostname != window.location.hostname) {
links[i].target = '_blank';
links[i].rel = 'noopener noreferrer';
}
}
</script>
View remove-cf7-css.php
<?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' ) ) {
View genesis-search-form-label.php
<?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...' );
View functions.php
<?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
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View wp-dashboard-widget.php
<?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');
}
View wp-admin-footer-text.php
View wp-failed-login.php
<?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.';
}
View wp-remember-me.php
<?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' )
;
}