Skip to content

Instantly share code, notes, and snippets.

@davidmh
davidmh / custom-post-type-archive-menu-links.php
Last active October 14, 2016 08:11 — forked from helgatheviking/custom-post-type-archive-menu-links.php
Adds Custom Post Type archives to the WordPress-powered menus. Compatible with WP 3.8
<?php
/*
Plugin Name: Custom Post Type Archive Menu Links
Plugin URI: http://codeseekah.com/2012/03/01/custom-post-type-archives-in-wordpress-menus-2/
Description: Easily Add Custom Post Type Archives to the Nav Menus
Version: 1.1
Author: soulseekah
Author URI: http://codeseekah.com
License: GPL2
@spigists
spigists / new_gist_file.css
Created October 2, 2013 16:16
Bootstrap 3 styles for Gravity Forms, make sure that in Forms > Settings you have Output CSS set to No and Output HTML5 set to Yes
.gform_wrapper ul {
padding-left: 0;
list-style: none; }
.gform_wrapper li {
margin-bottom: 15px; }
.gform_wrapper form {
margin-bottom: 0; }
@paulund
paulund / wordpress-base-custom-data.php
Created September 24, 2013 16:27
A PHP class to handle CRUD functionality in WordPress default tables.
<?php
/**
* Abstract class which has helper functions to get data from the database
*/
abstract class Base_Custom_Data
{
/**
* The current table name
*
* @var boolean
@JosefJezek
JosefJezek / wordpress-submenu-shortcode.php
Created June 19, 2013 09:40
WordPress Plugin Submenu Shortcode
<?php
/**
* @package Submenu Shortcode
* @version 1.0
*/
/*
Plugin Name: Submenu Shortcode
Plugin URI: https://gist.github.com/5813043
Description: Add Submenu with a shortcode: [submenu menu="Menu" level=2]. A plugin based on a script by <a href="http://www.cozmoslabs.com/1170-wp_nav_menu-shortcode/">Cozmoslabs</a>. Dependency on <a href="http://wordpress.org/plugins/codepress-menu">Codepress Menu</a>.
Author: Josef Jezek
@isGabe
isGabe / gravity-forms.scss
Created June 13, 2013 19:54
WordPress: Gravity Forms stylesheet, somewhat SASSified #WordPress #snippet
/*
----------------------------------------------------------------
Gravity Forms Front End Form Styles
Version 1.7
http: //www.gravityforms.com
updated: April 22, 2013 5:19 PM
*/
@wpscholar
wpscholar / shortcode.class.php
Last active September 20, 2017 23:27
Creating a class to handle a WordPress shortcode is overkill in most cases. However, it is extremely handy when your shortcode requires helper functions.
<?php
/**
* Creating a class to handle a WordPress shortcode is overkill in most cases.
* However, it is extremely handy when your shortcode requires helper functions.
*/
class My_Shortcode {
protected
$atts = array(),
@ajmalafif
ajmalafif / responsive-image.md
Last active December 11, 2015 21:28
[rwd] - Responsive image-handler resources
@sheabunge
sheabunge / widget-shortcode.php
Created December 12, 2012 10:33
Easily insert any WordPress sidebar widget into a post or page using a shortcode. http://wp.smashingmagazine.com/2012/12/11/inserting-widgets-with-shortcodes/
<?php
/**
* Plugin Name: Widget Shortcode
* Plugin URI: http://wp.smashingmagazine.com/2012/12/11/inserting-widgets-with-shortcodes/
* Description: Easily insert any WordPress sidebar widget into a post or page using a shortcode.
* Author: Smashing Magazine
* Author URI: http://www.smashingmagazine.com
* Version: 1.0
*/
@cbmd
cbmd / default.conf
Created December 9, 2012 21:13
nginx config - dynamic virtual hosts
server {
index index.php;
set $basepath "/var/www";
set $domain $host;
# check one name domain for simple application
if ($domain ~ "^(.[^.]*)\.dev$") {
set $domain $1;
set $rootpath "${domain}";