Skip to content

Instantly share code, notes, and snippets.

@jdabs
jdabs / gist:092bd78e31b12de522f037a5b9df57c9
Created August 22, 2017 14:49 — forked from ivandoric/gist:e4e46294c4d35eac0ec8
wordpress: create custom reset password page
<?php //Add all of this tu custom page template ?>
<?php
global $wpdb;
$error = '';
$success = '';
// check if we're in reset form
if( isset( $_POST['action'] ) && 'reset' == $_POST['action'] )
{
@jdabs
jdabs / menu-theme-fix
Created August 15, 2017 16:17
fix wp theme
// mobile menu fix
jQuery(window).load(function () {
function addDblClick() {
jQuery('#main-menu a.hasSubMenu').each(function () {
var cnt = 0;
jQuery(this).click(function () {
if (cnt >= 1) {
var link = jQuery(this).attr('href');
window.location = link;
}
@jdabs
jdabs / remove-billing.php
Last active June 21, 2017 19:49 — forked from jgalea/remove-billing.php
Remove billing details from WooCommerce checkout. Forked from: https://gist.github.com/jgalea/5884548#file-remove-billing-php
<?php
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
function custom_override_checkout_fields( $fields ) {
unset($fields['billing']['billing_first_name']);
unset($fields['billing']['billing_last_name']);
unset($fields['billing']['billing_company']);
unset($fields['billing']['billing_address_1']);
unset($fields['billing']['billing_address_2']);
<?php
defined( 'ABSPATH' ) or die();
// make all super admins automatically local admins of all child sites
function put_supers_as_admins() {
global $wp_roles, $user, $current_user;
$man_user_id = $current_user->ID;
$man_sites = get_sites();
jQuery('.the-filter-form-class').ajaxComplete(function() {
$('.selectpicker').selectpicker(); // re-init the thing on ajax done (sort of like a page load)
}
// 'prece
// http://silviomoreto.github.io/bootstrap-select
function wpdocs_theme_name_scripts() {
wp_enqueue_style( 'style-name', get_stylesheet_directory_uri().'style.css?ver='rand(1,9999) );
}
add_action( 'wp_enqueue_scripts', 'wpdocs_theme_name_scripts' );
@jdabs
jdabs / gist:8a9900733ad2ff7f4a4e
Last active August 29, 2015 14:18
Make "Google" text on google.com a cat image
/* download Stylish for Firefox https://addons.mozilla.org/en-Us/firefox/addon/stylish/
Make a new style for google.com and copy and paste the below
*/
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("www.google.com") {
#lga{
@jdabs
jdabs / gist:a8f2948ef47465d38f65
Last active August 29, 2015 14:13
markdown code highlight example
```javascript
<script>
$(document).ready(function () {
$('#input-menu').inputMenu();
});
</script>
```
@jdabs
jdabs / gist:b9febd71b8b6e8c3bbc3
Last active August 29, 2015 14:09
WAMP's httpd-vhosts.conf with google drive doc root
# add your Window's username in place of {yourName}
<VirtualHost *:80>
ServerAdmin webmaster@dummy.example.com
DocumentRoot "C:/Users/{yourName}/Google Drive/wamp/www"
ServerName localhost
ServerAlias localhost
ErrorLog "logs/localhost.log"
CustomLog "logs/localhost.log" common
</VirtualHost>
<link href="../core-field/core-field.html" rel="import">
<link href="../core-icon/core-icon.html" rel="import">
<link href="../core-input/core-input.html" rel="import">
<link href="../core-icons/core-icons.html" rel="import">
<polymer-element name="my-element">
<template>
<style>
#design_host {