This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Example code showing how to hook WordPress 3.0 to allow for querying multiple taxonomies | |
* Uses two (2) approaches: | |
* | |
* 1. A "tax_terms" URL parameter: WP_Query('tax_terms=type:dining,city:mb,package:discounts') | |
* 2. Taxonomies as URL parameters: WP_Query('type=dining&city=mb&package=discounts') | |
* | |
* To try this example: | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Example code showing how to hook WordPress 3.0 to allow for querying multiple meta_keys. | |
* It uses this approach for setting criteria where the keys get array indexed (the following | |
* query will query a hypothetical list of products for those colored Red and sized Large | |
* and it will sort them in price order: | |
* | |
* WP_Query('post_type=product&meta[color]=Red&meta[size]=Large&meta_key=price&orderby=meta_value_num') | |
* | |
* To try this example: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Answer to: http://wpquestions.com/question/show/id/694 | |
By: Mike Schinkel | |
Handles URL Rewriting in WordPress 3.0 like this: | |
fastigheter-spanien/X -> property/X&lang=sv | |
fastigheter-usa/X -> property/X&lang=sv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Handles URL Rewriting in WordPress 3.0 like this: | |
fastigheter-spanien/X -> property/X&lang=sv | |
fastigheter-usa/X -> property/X&lang=sv | |
properties-spain/X -> property/X&lang=en | |
properties-usa/X -> property/X&lang=en |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* TwentyTen functions and definitions | |
* | |
* Sets up the theme and provides some helper functions. Some helper functions | |
* are used in the theme as custom template tags. Others are attached to action and | |
* filter hooks in WordPress to change core functionality. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
PHP command-line shell script to access the WordPress database and print out the list of active plugins. | |
SYNTAX: | |
php wp-active-plugins.php $host $db $user $pw | |
For example: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Which performs better (in general) and why in a PHP app (WordPress) across many different potential web hosting scenarios? | |
The code is obviously psuedo-code mixing MYSQL+PHP. Reply via gmail to mikeschinkel. | |
1.) | |
$slug = 'actor' | |
SELECT p.post_title FROM wp_posts p | |
INNER JOIN wp_term_relationships tr ON p.ID=tr.object_id | |
INNER JOIN wp_term_taxonomy tt ON tr.term_taxonomy_id=tt.term_taxonomy_id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* See: http://wordpress.stackexchange.com/questions/859/ | |
* | |
*/ | |
include "wp-load.php"; | |
echo 'Jump to:'; | |
echo get_page_selector('My Select Menu'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Special Background | |
Plugin URI: http://wordpress.stackexchange.com/questions/972/ | |
Description: Example to show how to add a special background using exiting background admin page in core. | |
Version: 0.1 | |
Author: Mike Schinkel | |
Author URI: http://mikeschinkel.com/custom-wordpress-plugins/ | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: WP Boilerplate Shortcode | |
* Description: Provides a boilerplate post type and a shortcode for insertion into posts, pages and custom post types Requires WP >= v3.0. | |
* Plugin URI: http://mikeschinkel.com/wordpress-plugins/wp-boilerplate-shortcode/ | |
* Version: 1.0.4 | |
* Author: Mike Schinkel | |
* Author URI: http://mikeschinkel.com/wordpress-plugins/ | |
*/ |