Skip to content

Instantly share code, notes, and snippets.

View davidvandenbor's full-sized avatar

David van den Bor davidvandenbor

View GitHub Profile
@davidvandenbor
davidvandenbor / css-animaties-bibliotheekje.markdown
Last active April 30, 2020 15:19
CSS animaties bibliotheekje
@davidvandenbor
davidvandenbor / .gitignore
Last active January 30, 2022 18:23
CSS Grid imitating Bootstrap
.vscode
@davidvandenbor
davidvandenbor / cloudSettings
Last active September 21, 2018 04:37
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-09-21T04:37:54.337Z","extensionVersion":"v3.1.2"}
@davidvandenbor
davidvandenbor / woocommerce-query-loop.php
Last active July 24, 2016 22:31
WooCommerce custom Query Loop
<?php
/** ---------------------------------------------------------------------------- //
* @group WooCommerce custom Query Loop
* @author @david
*/
?>
<ul class="products">
<?php
$args = array('post_type' => 'product', 'posts_per_page' => 50, 'product_cat' => 'trousers', 'orderby' => 'rand');
$loop = new WP_Query($args);
@davidvandenbor
davidvandenbor / wordpress-excerpt-lenght.php
Last active July 15, 2016 00:04
WP custom excerpt lenght for global use
<?php
/**
* @author @david
* Wordpress excerpt lenght for global use, with automatic "read more"
*
*/
function et_excerpt_length($length) {
return 120;
}
add_filter('excerpt_length', 'et_excerpt_length');
@davidvandenbor
davidvandenbor / jquery-migrate-remove-from-wp-head.php
Last active December 29, 2015 00:01
Remove jQuery migrate script from WordPress head
<?php
/* -------------------------------------------------------------------------------//
* @group remove jquery migrate from header
*/
add_filter( 'wp_default_scripts', 'remove_jquery_migrate' );
function remove_jquery_migrate( &$scripts)
{
if(!is_admin())
{
$scripts->remove( 'jquery');
@davidvandenbor
davidvandenbor / add-custom-post-type-to-rss-feed.php
Last active December 28, 2015 23:57
Adding Custom Post types to WP RSS feed
<?php
/** ---------------------------------------------------------------------------- //
@group Add custom post types to feed
@author @david
*/
function add_custom_posts_to_rss_feed( $args ) {
if ( isset( $args['feed'] ) && !isset( $args['post_type'] ) )
$args['post_type'] = array('post', 'paintings');
return $args;
}
@davidvandenbor
davidvandenbor / wordPress-complex-quicktag-code-editor.php
Last active December 4, 2015 09:02
WordPress: complex HTML quicktag for code editor.
<?php
// Use these constructions when you want to insert large pieces of HTML code
// in Wordpress posts (with buttons in the HTML tab of the Wordpress editor) Insert
// buttons will appear in the HTML tab of the Wordpress editor!
function load_my_quicktags_inline() {
if ( wp_script_is( 'quicktags' ) ) { ?>
<script>
@davidvandenbor
davidvandenbor / html-insertion-jquery.js
Last active December 4, 2015 09:03
HTML code insertion in pages using jQuery
// this is how you can insert pieces of HTML code into pages using jQuery
var dynamic_html = "<div><span>Highlighted</span><span>Author</span></div>";
document.getElementByID("container").innerHTML = dynamic_html;
@davidvandenbor
davidvandenbor / responsive-centered-google-maps.css
Last active November 20, 2015 13:35
Responsive centered Google Maps
.container {
max-width: 640px;
max-height: 640px;
margin: 0 auto
}
.google_map
{
width: 100%;