Categories
WordPress

Loading a Google Font in WordPress

function load_fonts() { wp_enqueue_style(‘googleFonts’, ‘http://fonts.googleapis.com/css?family=Montserrat:400,700’); } add_action(‘wp_enqueue_scripts’, ‘load_fonts’); The proper way to load an external font library, such as from Google Fonts, is to use the wp_enqueue_scripts hook. You can use the above sample code in your functions.php code or load it up via a custom plugin. Breaking it down Couple of key points: “wp_enqueue_script” […]

Categories
Drupal Development Resources WordPress

Easy Responsive Form Fields

Dealing with form fields can be a little tricky when making a responsive theme for a website. You can code your CSS for each device or browser width, which can results in a lot of extra or redundant code, or you can use this simple technique. Set your text fields (or input/element of your choice) […]

Categories
Drupal Development Resources

Adding external style sheets to your Drupal theme

Sometimes it’s best to add external CSS files through Drupal’s drupal_add_css() function. A very practical example is where we add a Google web font to a subtheme. If you’re customizing a subtheme of a complex theme like Omega and don’t want to have to create a new page.tpl.php file just to add a custom style sheet, […]