Skip to content

Instantly share code, notes, and snippets.

View theodorocaliari's full-sized avatar
💻

Theodoro Caliari theodorocaliari

💻
View GitHub Profile
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
<?php
/* 1. Back End Usage
---------------------------------------------------------------------*/
// add neccessary actions
// @see http://codex.wordpress.org/Function_Reference/add_action
add_action( 'add_meta_boxes', 'rg_add_custom_box' );
add_action( 'save_post', 'rg_save_postdata', 10, 1 );
<?php
/* Register custom post types on the 'init' hook. */
add_action( 'init', 'my_register_post_types' );
/**
* Registers post types needed by the plugin.
*
* @since 0.1.0
* @access public
<?php
$menu_name = 'main_nav';
$locations = get_nav_menu_locations();
$menu = wp_get_nav_menu_object( $locations[ $menu_name ] );
$menuitems = wp_get_nav_menu_items( $menu->term_id, array( 'order' => 'DESC' ) );
?>
<nav>
<ul class="main-nav">
<?php
wget http://wordpress.org/latest.tar.gz
tar xfz latest.tar.gz
mv wordpress/* ./
rmdir ./wordpress/
rm -f latest.tar.gz

Capitalise titles in WordPress

Remove WordPress generator meta tag

<?php
/* Removes Wordpress Default Gallery css
------------------------------------------------------------ */
add_filter( 'use_default_gallery_style', '__return_false' );
<?php
add_filter( 'option_active_plugins', 'activate_local_plugins' );
/**
* Add our local plugins to the list of active plugins.
*/
function activate_local_plugins( $plugins ) {
if ( '127.0.0.1' == $_SERVER['SERVER_ADDR'] ) {
$local_plugins = array(
'wordpress-beta-tester/wp-beta-tester.php',
'wordpress-importer/wordpress-importer.php',
<?php
/**
* Front to the WordPress application. This file doesn't do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
* @package WordPress
*/
/**
* Tells WordPress to load the WordPress theme and output it.