This file contains hidden or 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 | |
/** | |
* 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( |
This file contains hidden or 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 | |
/* | |
* This solution assumes you've already set up your site so that the site domain is | |
* your "normal" (non-mobile) domain, and your theme is your non-mobile theme. | |
* | |
* In short, what it does it check to see if the site is being accessed through the | |
* mobile domain. If it is, the mobile theme is used instead of the normal theme, and | |
* all links point to the mobile domain (so navigatiion doesn't take visitors to the | |
* regular domain. |
This file contains hidden or 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
# custom login link | |
RewriteRule ^login$ http://localhost/whitelabel/wp-login.php [NC,L] |
This file contains hidden or 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
<html> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> | |
<script type="text/javascript"> | |
// Inspiration partly from: http://stackoverflow.com/questions/1897129 | |
jQuery(document).ready(function($) { | |
$('ul.dropdown').each(function(){ | |
var list = $(this); | |
var select = $(document.createElement('select')) | |
.attr('id',$(this).attr('id')) |
This file contains hidden or 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 | |
function yoast_oembed_dataparse( $html, $data, $url ) { | |
global $content_width; | |
preg_match( '/width="(\d+)"/', $html, $matches ); | |
$width = $matches[1]; | |
preg_match( '/height="(\d+)"/', $html, $matches ); | |
$height = $matches[1]; | |
$aspect_ratio = $width / $height; |
This file contains hidden or 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 | |
/** | |
* Class containing all the functionality to get data from the WordStream API | |
* | |
* @link http://api.wordstream.com/doc/introduction | |
* | |
* @author Joost de Valk <[email protected]> | |
* @license http://opensource.org/licenses/gpl-license.php GNU Public License | |
* |
This file contains hidden or 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 | |
function yoast_change_template( $template ) { | |
global $wp_query; | |
if ( !isset($wp_query->query_vars['taxonomy']) ) | |
return $template; | |
$taxonomy = get_taxonomy( $wp_query->query_vars['taxonomy'] ); | |
if ( is_search() && count( $taxonomy->object_type ) > 0 && !in_array( 'post', array_values($taxonomy->object_type) ) ) { | |
set_query_var('post_type', $taxonomy->object_type[0]); | |
$newtemplate = get_archive_template(); |
This file contains hidden or 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 | |
/** | |
* Image shortcode callback | |
* | |
* Enables the [kovshenin_image] shortcode, pseudo-TimThumb but creates resized and cropped image files | |
* from existing media library entries. Usage: | |
* [kovshenin_image src="http://example.org/wp-content/uploads/2012/03/image.png" width="100" height="100"] | |
* | |
* @uses image_make_intermediate_size | |
*/ |
This file contains hidden or 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
#!/bin/bash | |
sudo apt-get install php-pear | |
sudo pear upgrade pear | |
sudo pear channel-discover pear.phpunit.de | |
sudo pear channel-discover components.ez.no | |
sudo pear channel-discover pear.symfony-project.com |
This file contains hidden or 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 | |
////////////////// | |
// Screens | |
////////////////// | |
// Posts | |
foreach ( array( | |
'posts', 'pages', 'recipe_posts', | |
'edit-post', 'edit-page', 'edit-recipe', |