Skip to content

Instantly share code, notes, and snippets.

@psdtohtml5
psdtohtml5 / gist:5309266
Created April 4, 2013 10:09
WordPress : Register Taxonomy Hierarchical
//hook into the init action and call create_book_taxonomies when it fires
add_action( 'init', 'create_book_taxonomies', 0 );
//create two taxonomies, genres and writers for the post type "book"
function create_book_taxonomies()
{
// Add new taxonomy, make it hierarchical (like categories)
$labels = array(
'name' => _x( 'Genres', 'taxonomy general name' ),
'singular_name' => _x( 'Genre', 'taxonomy singular name' ),
@psdtohtml5
psdtohtml5 / gist:5309272
Created April 4, 2013 10:11
WordPress : Register Custom Taxonomy Non-hierarchical
// Add new taxonomy, NOT hierarchical (like tags)
$labels = array(
'name' => _x( 'Writers', 'taxonomy general name' ),
'singular_name' => _x( 'Writer', 'taxonomy singular name' ),
'search_items' => __( 'Search Writers' ),
'popular_items' => __( 'Popular Writers' ),
'all_items' => __( 'All Writers' ),
'parent_item' => null,
'parent_item_colon' => null,
'edit_item' => __( 'Edit Writer' ),
@psdtohtml5
psdtohtml5 / gist:5370138
Created April 12, 2013 07:17
Mobile : Responsive Navigation inside SELECT
// Mobile SELECT navigation for responsive websites
/**
* LEGENDS
*/
"#menu-main-menu" - is the Main Desktop Navigation UL
"select.navigation" - is the Mobile Navigation select element
/**
@psdtohtml5
psdtohtml5 / gist:5371167
Created April 12, 2013 10:39
WordPress : Add Meta Boxes
// Add Meta Boxes
$key = "portfolio"; // POST TYPE NAME
$meta_boxes = array(
"caption" => array(
"name" => "caption", // "name" attribute for input element
"title" => "Portfolio Item Caption", // "lable" of the field
"description" => "Description for this field" // helpful description shown in WordPress Admin Panel
),
"gallery" => array(
"name" => "gallery-id",
@psdtohtml5
psdtohtml5 / gist:5371285
Created April 12, 2013 11:06
HTML : Basic Form Structure
// Html basic form
<form id="" action="" method="post">
<table>
` <tr>
<td>Name</td>
<td>:</td>
<td><input id="" type="text" name="name" /></td>
</tr>
@psdtohtml5
psdtohtml5 / gist:5425421
Created April 20, 2013 09:42
HTML : Basic Contact Form
<table>
<form action="" method="">
<tr>
<td>Name</td>
<td><input type="text" class="" name="username" /></td>
</tr>
<tr>
<td>E-Mail</td>
<td><input type="text" class="" name="email" /></td>
</tr>
@psdtohtml5
psdtohtml5 / gist:5432566
Created April 22, 2013 05:11
HTML : Basic Form Structure
// Basic HTML Form
<form id="contact-form" class="span7 cf" action="" method="post">
<div id="status">
</div>
<legend>Leave us a message</legend>
<span class="col3 first">
<input type="text" id="name" name="name" placeholder="Name">
</span>
@psdtohtml5
psdtohtml5 / gist:5477621
Created April 28, 2013 17:28
jQuery : Multiple Videos In Lightbox
Multiple videos in Lightbox / Overlay
Dependencies:
http://releases.flowplayer.org/js/flowplayer-3.2.12.min.js
http://cdn.jquerytools.org/1.2.6/all/jquery.tools.min.js
The CSS
<style>
.overlay {
@psdtohtml5
psdtohtml5 / gist:5552934
Created May 10, 2013 07:28
WordPress : Getting All Categories
<?php
$args = array(
'type' => 'post',
'child_of' => 0,
'parent' => '',
'orderby' => 'name',
'order' => 'ASC',
'hide_empty' => 1,
'hierarchical' => 1,
'exclude' => '',
@psdtohtml5
psdtohtml5 / gist:5553482
Created May 10, 2013 09:46
WordPress : Creating Meta Box Link
https://github.com/bainternet/My-Meta-Box