Skip to content

Instantly share code, notes, and snippets.

@atsea
atsea / mobile tags for your '<head>'
Created July 24, 2011 21:45 — forked from chuanxshi/mobile tags for your '<head>'
mobile tags for your '<head>'
<!doctype html>
<!-- Helpful things to keep in your <head/>
// Shi Chuan, https://github.com/shichuan/mobile-html5-boilerplate
-->
<head>
<!-- consider using below meta tags if you want to disable format detection by default -->
<meta name="format-detection" content="telephone=no"/>
<meta name="format-detection" content="address=no"/>
<!-- consider using below link tag if the page is duplicate content of a desktop version -->
@atsea
atsea / css: opacity
Created March 20, 2012 15:57
cross browser opacity
{
zoom: 1;
filter: alpha(opacity=50);
opacity: 0.5;
}
@atsea
atsea / divi-remove-copyright
Created July 10, 2014 17:50
Remove copyright from Divi theme
class checkbox_platform{
public static function getPlatform(){
$template_swplatform = array(
'Windows' => 'Windows',
'Mac' => 'Mac',
'Linux' => 'Linux',
'Unix' => 'Unix'
);
return $template_swplatform;
@atsea
atsea / gist:5af186392cfd021c9b1a
Created August 6, 2014 15:16
WordPress: Select list Class
class dropdown_category{
public static function getCategory(){
$template_swcategory = array(
' '=>"No Category",
'Antivirus and Security' => 'Antivirus and Security',
'Creativity' => 'Creativity',
'Database' => 'Database',
'Geographic Info Systems' => 'Geographic Info Systems',
'Graphing' => 'Graphing',
@atsea
atsea / gist:d361ff73e8f03e5d90b8
Last active August 29, 2015 14:04
WordPress: Get the Current Taxonomy of the Post
require_once('functions.php');
if ( is_active_sidebar( 'sidebar-1' ) ){
$terms = get_the_terms( $post->ID, 'software_categories' );
foreach ( $terms as $term ) {
$term_link = get_term_link( $term, 'software_categories' );
echo "<a href='".$term_link."'>" . $term->name . "</a>, ";
@atsea
atsea / extend_nav_walker_class.php
Created August 13, 2014 14:15
WordPress: Extend Nav Walker Class
/**
* Create HTML list of nav menu items.
* Replacement for the native Walker, using the description.
* Goes with Line #68 in header.php
*
* @see http://wordpress.stackexchange.com/q/14037/
* @author toscho, http://toscho.de
*/
class Description_Walker extends Walker_Nav_Menu
{
@atsea
atsea / gist:c5faf13eb0a6fb0cf687
Created August 14, 2014 16:00
WordPress: Extend Nav Walker Class for $terms seach
<?php
/**
* Taxonomy Drop Down with hierarchical view using $terms
* http://wordpress.stackexchange.com/questions/73583/taxonomy-drop-down-with-hierarchical-view-using-terms
*/
// Equipment Category Dropdown, thanks https://gist.github.com/2902509
class Walker_SlugValueCategoryDropdown extends Walker_CategoryDropdown {
function start_el(&$output, $category, $depth, $args) {
$pad = str_repeat('&nbsp;', $depth * 3);
@atsea
atsea / output-taxonomy-slugs.php
Created August 25, 2014 17:16
WordPress: Output Taxonomy Slugs
<?php
/**
* Output Taxonomy Slugs
* http://wordpress.org/support/topic/output-taxonomy-slugs
*/
// function my_dropdown($name, $taxonomy = 'category') {
// $defaults = array(
// 'taxonomy' => $taxonomy,
// 'id' => $name,
// 'name' => $name,
@atsea
atsea / wp-jqueryui-cdn
Created September 26, 2014 14:14
tell WordPress to load the Smoothness theme from Google CDN
// tell WordPress to load the Smoothness theme from Google CDN
$protocol = is_ssl() ? 'https' : 'http';
$url = "$protocol://code.jquery.com/ui/1.11.1/themes/smoothness/jquery-ui.css";
wp_enqueue_style('jquery-ui-smoothness', $url, false, null);