Skip to content

Instantly share code, notes, and snippets.

var isMac = navigator.platform.toUpperCase().indexOf('MAC')>=0;
function modify_jquery_version() {
if (!is_admin()) {
wp_deregister_script('jquery');
wp_register_script('jquery',
'https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js', false, '2.1.s');
wp_enqueue_script('jquery');
}
}
add_action('init', 'modify_jquery_version');
@Farmatique
Farmatique / gist:f73684ffa1a718e1ba93de5980aeb107
Created May 25, 2017 11:41
Wordpress contact-form-7 use <button> instead <input> for submit
<button id='submit' class='wpcf7-form-control wpcf7-submit'>SUBMIT <span class='glyphicon glyphicon-menu-right'></span></button>
<!--[if lt IE 9]>
<script>
var e = ("article,aside,figcaption,figure,footer,header,hgroup,nav,section,time").split(',');
for (var i = 0; i < e.length; i++) {
document.createElement(e[i]);
}
</script>
<![endif]-->
@Farmatique
Farmatique / gist:98390c7786af019d3f10fe7ad5404e96
Created June 30, 2017 10:34
add/remove "expanded" class for mobile header by clicking on toogle-button (collapse/expand)
/* toggle class in header on expanding mobile menu */
jQuery('#bs-example-navbar-collapse-1').on('show.bs.collapse', function () {
jQuery('header').addClass('expanded');
})
jQuery('#bs-example-navbar-collapse-1').on('hide.bs.collapse', function () {
jQuery('header').removeClass('expanded');
})
img[src$=".gif"], img[src$=".png"] {
image-rendering: -moz-crisp-edges; /* Firefox */
image-rendering: -o-crisp-edges; /* Opera */
image-rendering: -webkit-optimize-contrast;/* Webkit (non-standard naming) */
image-rendering: crisp-edges;
-ms-interpolation-mode: nearest-neighbor; /* IE (non-standard property) */
}
ul {
-webkit-columns: 2;
-moz-columns: 2;
columns: 2;
list-style-position: inside;
}
@Farmatique
Farmatique / gist:e45eaaad5bcb439c3d9bdc2ca4f26f1a
Created July 12, 2017 18:38
allow wordpress to upload svg
/* insert inside functions.php */
function cc_mime_types($mimes) {
$mimes['svg'] = 'image/svg+xml';
return $mimes;
}
add_filter('upload_mimes', 'cc_mime_types');
<ul>
<li class="item-1"></li>
<li class="item-2"></li>
<li class="item-3"></li>
<li class="item-4"></li>
<li class="item-5"></li>
</ul>
li{
background-color: red;
ul{
list-style: none;
list-style-position: inside;
}
ul li:before{
display: inline-block;
content: "•";
width: 5px;
height: auto;