Skip to content

Instantly share code, notes, and snippets.

View DeveloperWilco's full-sized avatar

Wilco DeveloperWilco

View GitHub Profile
// Backgrounds
.row{
&.main-buttons{
background: $primary-background-color;
margin-bottom: 70px;
.blocks-container{
@DeveloperWilco
DeveloperWilco / bootstrap-suggest.js
Created March 22, 2018 15:05
A better bootstrap-suggest.js.
$( document ).ready( function() {
var users = [
{username: 'User 1', fullname: 'User Name 1'},
{username: 'User 2', fullname: 'User Name 2'},
{username: 'User 3', fullname: 'User Name 3'},
];
$( 'textarea' ).suggest('@', {
@DeveloperWilco
DeveloperWilco / bootstrap-suggest.css
Created March 22, 2018 14:59
Put the following css in the bootstrap-suggest.css file. Now you don't have to load the whole bootstrap.css anymore
.dropdown{
position: relative;
}
.dropdown-menu{
position: absolute;
top: 100%;
left: 0;
add_filter('manage_posts_columns', 'my_columns');
function my_columns($columns) {
$columns['status'] = 'Status płatności';
return $columns;
}
add_action('manage_posts_custom_column', 'my_show_columns');
function my_show_columns($name) {
global $post;
switch ($name) {
@DeveloperWilco
DeveloperWilco / gist:ee6a2509d9c96a26d654aab93a7ea1f9
Created November 2, 2017 18:45 — forked from fjarrett/gist:5544469
Return an attachment ID using a URL in WordPress
<?php
/**
* Return an ID of an attachment by searching the database with the file URL.
*
* First checks to see if the $url is pointing to a file that exists in
* the wp-content directory. If so, then we search the database for a
* partial match consisting of the remaining path AFTER the wp-content
* directory. Finally, if a match is found the attachment ID will be
* returned.
*
@DeveloperWilco
DeveloperWilco / dl-file.php
Created October 30, 2017 15:51 — forked from hakre/dl-file.php
Wordpress login to download uploaded files
<?php
/*
* dl-file.php
*
* Protect uploaded files with login.
*
* @link http://wordpress.stackexchange.com/questions/37144/protect-wordpress-uploads-if-user-is-not-logged-in
*
* @author hakre <http://hakre.wordpress.com/>
* @license GPL-3.0+
@DeveloperWilco
DeveloperWilco / email-confirmation.php
Last active August 31, 2017 15:36 — forked from elclanrs/email-confirmation.php
Simple e-mail confirmation plugin for WordPress.
<?php
class EmailConfirmation{
// Create prefix
const PREFIX = 'email-confirmation-';
public static function send($to, $subject, $message, $headers){
$token = sha1(uniqid());
$oldData = get_option(self::PREFIX .'data') ?: array();
img{
-webkit-transition: all 3s ease;
-moz-transition: all 3s ease;
-o-transition: all 3s ease;
transition: all 3s ease;
}
article:hover img{
-webkit-transform: scale(1.1);
@DeveloperWilco
DeveloperWilco / functions.php
Created June 21, 2017 14:09
cleaning url after filter
add_action( 'wp_head', function() {
?>
<script>
(function($) {
$(document).on('facetwp-loaded', function() {
var url = window.location.pathname;
return history.pushState(null, null, url.replace(/&view=.*(&?)/, '$1'));
});
})(jQuery);
@DeveloperWilco
DeveloperWilco / source.txt
Created June 21, 2017 14:06
Source code flexslider/facetwp conflict
<div id="main-slider" class=""><div class="flexslider"><ul class="slides"><!--fwp-loop-->
<li data-thumb="http://bedrijfsvaatwassers.buro210.com/wp-content/uploads/2017/06/slider-2.jpg" style='background-position: center;background-size: cover;background-repeat: no-repeat;background-image: url(http://bedrijfsvaatwassers.buro210.com/wp-content/uploads/2017/06/slider-2.jpg);'>
<div class='slider-content-container'>
<div class='full-row'>
<div class='slider-content'>
<h1 style="text-align: center;"><strong>Welkom</strong> bij bedrijfsvaatwassers.nl</h1>
<p style="text-align: center;">Bedrijfsvaatwassers.nl levert uit voorraad uitstekende professionele horeca vaatwassers en aanverwante producten tegen de scherpste prijs. Onze vaatwassers laten wij in Italië maken bij o.a. Silanos Krupps en Aristarco. Maar ook merken als Meiko, Hobart, Ecomax en Bar Aid ontbreken niet. Al deze merken zijn al jaren lang specialisten op vaatwas gebied. Samen met onze 35 jaar ervaring heeft dit geleid tot een hoogw