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
$taxonomies = array( | |
'custom_category' | |
); | |
$args = array( | |
'orderby' => 'name', | |
'order' => 'ASC', | |
'hide_empty' => false, | |
'exclude' => array(), | |
'exclude_tree' => array(), |
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
/* | |
* Filter the wp_get_archives() so a cat_id can be added | |
* Example: wp_get_cat_archives('type=monthly&format=option&show_post_count=1', 46); | |
* in this case '46' = the category id | |
*/ | |
add_filter('getarchives_where', 'custom_archives_where', 10, 2); | |
add_filter('getarchives_join', 'custom_archives_join', 10, 2); | |
function custom_archives_join($x, $r) { |
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
add_filter('posts_clauses', 'posts_clauses_with_tax', 10, 2); | |
function posts_clauses_with_tax( $clauses, $wp_query ) { | |
global $wpdb; | |
//array of sortable taxonomies | |
$taxonomies = array('example-taxonomy', 'other-taxonomy'); | |
if (isset($wp_query->query['orderby']) && in_array($wp_query->query['orderby'], $taxonomies)) { | |
$clauses['join'] .= " | |
LEFT OUTER JOIN {$wpdb->term_relationships} AS rel2 ON {$wpdb->posts}.ID = rel2.object_id | |
LEFT OUTER JOIN {$wpdb->term_taxonomy} AS tax2 ON rel2.term_taxonomy_id = tax2.term_taxonomy_id | |
LEFT OUTER JOIN {$wpdb->terms} USING (term_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 | |
require_once dirname( __FILE__ ) . '/class.settings-api.php'; | |
/** | |
* Theme Admin panel for Tareq's Planet | |
* | |
* @author Tareq Hasan | |
*/ | |
class Tareqs_Planet_Admin { |
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 | |
if(isset($_POST['submit'])): | |
if(isset($_POST['g-recaptcha-response']) && !empty($_POST['g-recaptcha-response'])): | |
//your site secret key | |
$secret = 'InsertSiteSecretKey'; | |
//get verify response data | |
$verifyResponse = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret='.$secret.'&response='.$_POST['g-recaptcha-response']); | |
$responseData = json_decode($verifyResponse); | |
$name = !empty($_POST['name'])?$_POST['name']:''; |
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
DateTime.ToString() Patterns | |
All the patterns: | |
0 MM/dd/yyyy 08/22/2006 | |
1 dddd, dd MMMM yyyy Tuesday, 22 August 2006 | |
2 dddd, dd MMMM yyyy HH:mm Tuesday, 22 August 2006 06:30 | |
3 dddd, dd MMMM yyyy hh:mm tt Tuesday, 22 August 2006 06:30 AM | |
4 dddd, dd MMMM yyyy H:mm Tuesday, 22 August 2006 6:30 | |
5 dddd, dd MMMM yyyy h:mm tt Tuesday, 22 August 2006 6:30 AM |
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
<? | |
// This is a sub query for pulling data from outside of the loop.. | |
// However, we need to preserve the original $wp_query if this is inside an existing loop. | |
// If this is the last query, then you can ditch it. | |
$temp = $wp_query; | |
$wp_query = null; | |
$wp_query = new WP_Query(); | |
$wp_query->query('your-custom-query'); |
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
<select name="timezone_offset" id="timezone-offset" class="span5"> | |
<option value="-12:00">(GMT -12:00) Eniwetok, Kwajalein</option> | |
<option value="-11:00">(GMT -11:00) Midway Island, Samoa</option> | |
<option value="-10:00">(GMT -10:00) Hawaii</option> | |
<option value="-09:50">(GMT -9:30) Taiohae</option> | |
<option value="-09:00">(GMT -9:00) Alaska</option> | |
<option value="-08:00">(GMT -8:00) Pacific Time (US & Canada)</option> | |
<option value="-07:00">(GMT -7:00) Mountain Time (US & Canada)</option> | |
<option value="-06:00">(GMT -6:00) Central Time (US & Canada), Mexico City</option> | |
<option value="-05:00">(GMT -5:00) Eastern Time (US & Canada), Bogota, Lima</option> |
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
" Use Vim settings, rather than Vi settings (much better!). | |
" This must be first, because it changes other options as a side effect. | |
set nocompatible | |
syntax on | |
filetype on | |
filetype plugin on | |
filetype indent on | |
behave mswin | |
runtime macros/matchit.vim |
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
--- ----------------- ---- | |
Map Quick Explanation Link | |
--- ----------------- ---- | |
< <F1> Causes Netrw to issue help | |
<cr> Netrw will enter the directory or read the file |netrw-cr| | |
<del> Netrw will attempt to remove the file/directory |netrw-del| | |
<c-h> Edit file hiding list |netrw-ctrl-h| | |
<c-l> Causes Netrw to refresh the directory listing |netrw-ctrl-l| | |
<c-r> Browse using a gvim server |netrw-ctrl-r| | |
<c-tab> Shrink/expand a netrw/explore window |netrw-c-tab| |
OlderNewer