Skip to content

Instantly share code, notes, and snippets.

@sercomi
sercomi / gist:1991927
Created March 7, 2012 08:31
WP: Plugin comment
<?php
/*
Plugin Name:
Plugin URI:
Description:
Version:
Author:
Author URI:
*/
@sercomi
sercomi / gist:1991935
Created March 7, 2012 08:34
WP: Theme comment
<?php
/**
* The main template file.
*
* This theme is purely for the purpose of testing theme options in Options Framework plugin.
*
* @package WordPress
* @subpackage Options Check
*/
@sercomi
sercomi / gist:1992074
Created March 7, 2012 09:07
HTML: HTML5 template
<!doctype html>
<html class="no-js" lang="es">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<meta name="author" content="">
@sercomi
sercomi / run-once.php
Created March 8, 2012 09:34
WP: Run once function
<?php
/**
* The main template file.
*
* @package WordPress
*/
function run_once($key){
$test_case = get_option('run_once');
@sercomi
sercomi / gist:2204531
Created March 26, 2012 11:34
WP: Theme development style.css
/*
Theme Name: [Theme name]
Theme URI: [Theme url]
Description: [Theme description]
Author: [Theme author]
Author URI: [Author URL]
Version: 1.0
Tags: black, blue, white, two-columns, fixed-width, custom-header, custom-background, threaded-comments, sticky-post, translation-ready, microformats, rtl-language-support, editor-style, custom-menu (optional)
License:
@sercomi
sercomi / gist:2205296
Created March 26, 2012 14:03
WP: Pages titles
<title><?php
if (is_home () || is_front_page() ) {
bloginfo('name');
} elseif ( is_category() ) {
single_cat_title(); echo ' - ' ;
bloginfo('name');
} elseif (is_single() ) {
single_post_title();
} elseif (is_page() ) {
bloginfo('name');
@sercomi
sercomi / theme-setup.php
Created March 26, 2012 15:10
WP: Theme setup function
<?php
/**
* Theme setup.
*
* @package WordPress
*/
function theme_setup()
{
@sercomi
sercomi / sidebar.php
Created March 26, 2012 15:16
WP: Setup widgets sidebar
<?php
/**
* The sidebar file.
*
* @package WordPress
*/
register_sidebar(array(
'name' => 'Main sidebar',
'id' => 'main-sidebar',
@sercomi
sercomi / gist:2248792
Created March 30, 2012 07:32
WP: Cron jobs
//Crear un nuevo temporizador
add_filter('cron_schedules', 'add_scheduled_interval');
// Anyade nuevos intervalos a wp_schedules
function add_scheduled_interval($schedules)
{
$schedules['minutes_1'] = array('interval'=>60, 'display'=>'Once 1 minutes');
$schedules['minutes_30'] = array('interval'=>30, 'display'=>'Once 30 minutes');
return $schedules;
}
@sercomi
sercomi / index.php
Created March 30, 2012 07:42
WP: List Cronjobs in the footer
<?php
/*
Plugin Name: WP Cron Jobs
Plugin URI: https://github.com/franz-josef-kaiser
Description: List WordPress internal cron jobs (array data) in the footer. The hook 'wp_footer()' must be present in your theme.
Author: Franz Josef Kaiser
Author URI: https://github.com/franz-josef-kaiser
Version: 0.1
License: GPL v2 - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html