Skip to content

Instantly share code, notes, and snippets.

@remkus
remkus / add-menu.php
Created March 22, 2012 18:59
Pre populate Custom Menus
<?php
add_action( 'init', 'add_menus' );
function add_menus() {
register_nav_menus( array( 'main_nav' =--> 'The main menu', ) );
$new_menu_id = wp_create_nav_menu( 'Main Menu' );
@remkus
remkus / rkv_date_convert
Created April 1, 2012 17:32 — forked from norcross/rkv_date_convert
Convert date entry to UNIX timestamp
// Make two admin-only fields (as text fields)
// and post to the custom fields from Gravity Forms
// instead of the "real" date picker.
// NOTE: change the input IDs to match the ones on your form
function rkv_datesubmit_fix ($form){
//event start date field id is 3
//event end date field ID is 4
$raw_srt = $_POST['input_3'];
$raw_end = $_POST['input_4'];
<?php
add_filter( 'genesis_author_box', 'zip_author_box', 10, 6 );
/**
* Filters author box by adding extra link
*
* @access public
* @param mixed $output
* @param mixed $context
* @param mixed $pattern
@remkus
remkus / gist:2580322
Created May 2, 2012 20:42
Filter one Post Format via a Custom Loop.
<?php
$args = array(
'post_type' => 'post',
'post_status' => 'publish',
'order' => 'DESC',
'tax_query' => array(
array(
'taxonomy' => 'post_format',
'field' => 'slug',
@remkus
remkus / functions.php
Created June 5, 2012 18:41 — forked from gregrickaby/functions.php
Custom Post-Info with Google Rich Snippet support
remove_action( 'genesis_before_post_content', 'genesis_post_info' );
add_action( 'genesis_before_post_content', 'child_post_info' );
/**
* Custom Post-Info with Google Rich Snippet support
*
* @author Greg Rickaby
* @since 1.0.0
*/
function child_post_info() {
if ( is_page() )
@remkus
remkus / gist:2941390
Created June 16, 2012 13:55
Add WordPress' thickbox
<?php
add_action( 'init','fsm_thickbox' );
/**
* fsm_thickbox function.
*
* @access public
* @param mixed $text
* @return void
@remkus
remkus / gist:2947461
Created June 18, 2012 08:20
Change author link in Genesis Post Info
<?php
add_filter( 'genesis_post_info', 'custom_post_info_filter' );
/**
* Modify author link in Post Info to website.
*
* @access public
* @author Remkus de Vries
* @link http://remkusdevries.com/change-author-link/
* @param mixed $post_info
@remkus
remkus / Gruntfile.js
Created October 7, 2015 15:35
Gruntfile.js example
/*global node:true */
module.exports = function( grunt ) {
'use strict';
require('matchdep').filterDev('grunt-*').forEach( grunt.loadNpmTasks );
grunt.initConfig({
makepot: {
@remkus
remkus / gist:3827005
Created October 3, 2012 13:50
Add category to bodyclass
<?php
add_filter( 'body_class', 'fst_category_id_class' );
/**
* This function add the category name to the bodyclass.
*
* @access public
* @author Remkus de Vries
* @param mixed $classes
* @return void
@remkus
remkus / deploy.sh
Created October 4, 2012 17:44 — forked from BFTrick/deploy.sh
WordPress Plugin Deploy Script
#! /bin/bash
# A modification of Dean Clatworthy's deploy script as found here: https://github.com/deanc/wordpress-plugin-git-svn
# The difference is that this script lives in the plugin's git repo & doesn't require an existing SVN repo.
# main config
PLUGINSLUG="______your-plugin-name______"
CURRENTDIR=`pwd`
MAINFILE="______your-plugin-name______.php" # this should be the name of your main php file in the wordpress plugin
# git config