WordPress Quick Tips #1

Enqueue Multiple Google Fonts into One Stylesheet

Taking the twenty-fourteen theme for example, modify the ‘functions.php’ by separate the differents fonts that is to be used with a pipe character in the twentyfourteen_font_url function.

Single Stylesheet for a Group of Fonts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
function twentyfourteen_font_url() {
$font_url = '';

if ( 'off' !== _x( 'on', 'Oswald font: on or off', 'twentyfourteen' ) ) {
$font_url = add_query_arg( 'family', urlencode( 'Oswald:400|Droid Sans:400'), "//fonts.googleapis.com/css" );
}

return $font_url;
}

function twentyfourteen_scripts() {
wp_enqueue_style( 'googlefont-oswald-and-opensans', twentyfourteen_font_url(), array(), null );

//...
}

add_action( 'wp_enqueue_scripts', 'twentyfourteen_scripts' );

Bouncing Contact Form 7 Emails

If you wish to receive messages from the Contact Form 7 form to your personal email, but the behavior is spotty (emails not being sent to you), then it would help to install the Flamingo plugin. This plugin will save messages in WordPress, such that messages will be accessible from the WordPress dashboard.