Skip to content

Instantly share code, notes, and snippets.

// Register all the javascript and css we need to accompany those scripts
add_action( 'wp_enqueue_scripts', 'html5press_register_scripts' );
add_action( 'wp_print_styles', 'html5press_register_styles' );
function html5press_register_scripts() {
/**
* Modernizr enables HTML5 elements & feature detects
* For optimal performance, use a custom Modernizr build: www.modernizr.com/download/
*/
@jayj
jayj / gist:1189642
Created September 2, 2011 19:33
Custom "Download" metabox for tutorial on Jayj.dk
<?php
/**
* Custom "Download" custom type metabox for tutorial on Jayj.dk
*
* @link http://jayj.dk/
*/
/**
* Adds the download meta box for the download post type
*/
@jayj
jayj / gist:1190106
Created September 2, 2011 22:30
Full code for tutorial on Jayj.dk
<?php
/**
* Custom "Download" custom type for tutorial on Jayj.dk
*
* @link http://jayj.dk/2011/download-cpt-wordpress
*/
add_action( 'init', 'jayj_create_download_post_type' );
@jayj
jayj / gist:1306314
Created October 22, 2011 18:23
Part of tutorial on Jayj.dk
/**
* Format: box
*/
if ( 'box' == $format ) :
$meta = get_post_meta( $id, 'download', true );
$count_meta = get_post_meta( $id, 'download_count', true );
// Start content
ob_start();
// A video button with parameters
QTags.VideoButton = function() {
QTags.TagButton.call(this, 'Video', 'video', '', '', 'm' );
};
QTags.VideoButton.prototype = new QTags.TagButton();
QTags.VideoButton.prototype.callback = function(e, c, ed) {
// The different parameters and their default value
var src = prompt( 'Enter URL for video', 'http://' ),
@jayj
jayj / gist:1499184
Created December 19, 2011 22:21
Jayj Quicktag 1.1.1
<?php
/**
* Plugin Name: Jayj Quicktag
* Plugin URI: http://jayj.dk/plugins/jayj-quicktag/
* Description: Allows you to easily add custom quicktags to the editor. Requires at least WordPress 3.3 to work
* Author: Jesper J
* Author URI: http://jayj.dk
* Version: 1.1.1
* License: GPLv2 or later
*/
@jayj
jayj / functions.php
Created September 2, 2012 20:20
Japibas Theme Layouts
<?php
/**
* Add the Theme Layous extension
*
*** Completely untested ***
*/
function my_japibas_child_layout_options() {
include( get_stylesheet_directory() . '/theme-layouts.php' );
add_theme_support( 'theme-layouts', array( '1c', '2c-l', '2c-r' ) );
@jayj
jayj / gist:3888408
Created October 14, 2012 12:31
Chat post format
<!--///////////// -->
<!-- OLD MARKUP -->
<!--///////////// -->
<div class="chat-row chat-speaker-3">
<div class="chat-author chat-author-begbie vcard"><cite class="fn">BEGBIE</cite>:</div>
<div class="chat-text"><p>You daft cunt. If you&#8217;re going to waste it like that, you might as well leave it all to me. Now get the drinks in.</p></div>
</div><!-- .chat-row -->
<div class="chat-row chat-speaker-3">
<div class="container">
<div class="col">1</div>
<div class="col">2</div>
<div class="col">3</div>
<div class="col">4</div>
@jayj
jayj / flexbox.less
Last active November 20, 2023 04:51
CSS3 Flexbox - LESS Mixins
// --------------------------------------------------
// Flexbox LESS mixins
// The spec: http://www.w3.org/TR/css3-flexbox
// --------------------------------------------------
// Flexbox display
// flex or inline-flex
.flex-display(@display: flex) {
display: ~"-webkit-@{display}";
display: ~"-ms-@{display}box"; // IE10 uses -ms-flexbox