Skip to content

Instantly share code, notes, and snippets.

View ajuliano's full-sized avatar

Albert Johansson ajuliano

View GitHub Profile
@ajuliano
ajuliano / wpadverts-mal-fix-location-dropdown-bug
Created October 4, 2016 22:08
The autocomplete form in the wpadverts-mal plugin triggers the submit button when pushing Enter when a location is selected in the dropdown, but the location is not saved.
/*
* Added on line 139 in the file wpadverts-mal/assets/js/map-single.js in plugin version 1.1.1
*/
google.maps.event.addDomListener(input, 'keydown', function(e) {
if (e.keyCode == 13) {
e.preventDefault();
}
});
@ajuliano
ajuliano / utilities
Last active November 29, 2016 07:44
/*
* https://css-tricks.com/snippets/css/truncate-string-with-ellipsis/
*
*/
.u-truncate {
width: 250px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
@ajuliano
ajuliano / head-wordpress
Last active July 5, 2017 14:12
Standard head on in WordPress-projects
<!doctype html>
<html <?php language_attributes(); ?> class="no-js <?php echo wp_is_mobile() ? 'mobile' : ''; ?>">
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
@ajuliano
ajuliano / .gitignore
Last active August 15, 2018 11:16
Recommended .gitignore for WP Engine
*~
wp-content/*
!wp-content/themes/
wp-content/themes/*
# Change THEMENAME to the current theme name
!wp-content/themes/THEMENAME/*
wp-content/themes/THEMENAME/.sass-cache/*