Skip to content

Instantly share code, notes, and snippets.

(function ($) {
"use strict";
$(function() {
$('.more .more-trigger').on('click', function(e) {
var $this = $(this),
text = $this.hasClass('open') ? 'more' : 'less';
$this
.text( text )
@kprimdal-dk
kprimdal-dk / gist:5144048
Last active December 14, 2015 20:28
WordPress Iframe Shortcode
function mux_iframe($atts, $content = null) {
extract( shortcode_atts(
array(
'width' => '558',
'height' => '250',
'overflow' => 'hidden',
'scrolling' => 'no',
'frameborder' => '0'
), $atts)
);
@kprimdal-dk
kprimdal-dk / admin.js
Created February 27, 2013 12:41
WordPress Meta field repeater - ( taken from Easy Digital Download )
jQuery(document).ready(function ($) {
var mux_repeater_configuation = {
init: function() {
this.add();
this.remove();
},
add: function() {
$('body').on('click', '.mux_ps_add_repeatable', function(e) {
e.preventDefault();
@kprimdal-dk
kprimdal-dk / gist:5019250
Created February 23, 2013 10:36
Convert Post, Commets and Categories to bbPress
<?php
require_once('wp-blog-header.php');
set_time_limit(0);
$categories = get_terms('category');
foreach ($categories as $category) {
$default_forum = array(
@kprimdal-dk
kprimdal-dk / gist:5003892
Last active December 14, 2015 01:09
Href Lang i Header på bestemt side
<?php
function mux_header_lang() {
global $post;
if ( is_page() ) {
$hreflang = get_post_meta( $post->ID, 'hreflang', true );
if ( $hreflang ) {
$ref = get_post_meta( $post->ID, 'ref', true );
?>
<link rel="alternate" hreflang="<?php echo $hreflang ?>" href="<?php echo $ref ?>" />
<?php
@kprimdal-dk
kprimdal-dk / gist:4740497
Last active December 12, 2015 07:58
Partner Visual Website Optimizer
<script type="text/javascript">
// *****
// SET DEFAULT AUTHOR ID
// *****
var vwoAuthor = '1324';
var _vwo_code, account_id,
ownDomain = location.hostname,
referrerDomain = document.referrer.split('/')[2];
(function($) {
$.fn.countdown = function(options, callback) {
//custom 'this' selector
thisEl = $(this);
//array of custom settings
var settings = {
'date': null,
'format': null
@kprimdal-dk
kprimdal-dk / gist:3937592
Created October 23, 2012 08:15
Javascript: Page Reload Every X miliseconds
<script>
function reFresh() {
location.reload(true)
}
window.setInterval("reFresh()",10000);
</script>
@kprimdal-dk
kprimdal-dk / gist:3878171
Created October 12, 2012 08:55
WordPress New Users added to Mailchimp
<?php
/*
Plugin Name: Primux Mailchimp
Plugin URI: http://primux.dk/
Description: Add new users to a Mailchimp list
Version: 1.0
Author: Primux Media
Author URI: http://primux.dk/
*/
@kprimdal-dk
kprimdal-dk / embed-gist.php
Created October 3, 2012 10:03 — forked from roborourke/embed-gist.php
Adds autoembedding of gist urls in WordPress
<?php
/**
* Usage:
* Paste a gist link into a blog post or page and it will be embedded eg:
* https://gist.github.com/2926827
*
* If a gist has multiple files you can select one using a url in the following format:
* https://gist.github.com/2926827?file=embed-gist.php
*/