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 | |
/* | |
**** Load jQuery from Google CDN if available, local fallback if not **** | |
** Place in your theme's functions.php or relevant file. Edit local jQuery path if needed. | |
** Works as-is with WordPress Bones Theme v1.2 https://github.com/eddiemachado/bones (replace wp_enqueue_script( 'jquery' ); on line 142 | |
** reference: http://wp.tutsplus.com/tutorials/load-jquery-from-google-cdn-with-local-fallback-for-wordpress/ | |
*/ |
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 | |
$parent = "PARENT_PAGE_ID"; | |
$args = array( | |
'depth' => 0, | |
'show_date' => '', | |
'date_format' => get_option('date_format'), | |
'child_of' => $parent, | |
'exclude' => '', | |
'include' => '', | |
'title_li' => __(''), |
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 | |
query_posts('YOUR QUERY HERE'); | |
$i = 0; | |
// Thanks to PaoloVIP for the suggestion to add round() for loops with an odd # of results | |
if ( have_posts() ) : while ( have_posts() ) : the_post(); | |
if ($i == 0) echo '<div id="left">'; | |
if ($i == (round($wp_query->post_count / 2))) echo '</div><div id="right">'; | |
the_content(); // or whatever custom content you desire | |
if ($i == round($wp_query->post_count)) echo '</div>'; | |
$i++; |
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 | |
/** | |
* 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.5.1/wp-includes/query.php | |
* http://www.inteligraphics.ro/2013/06/20/wordpress-wp_query-args-parameters-list/ | |
*/ |
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 | |
function revconcept_get_images($post_id) { | |
global $post; | |
$thumbnail_ID = get_post_thumbnail_id(); | |
$images = get_children( array('post_parent' => $post_id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID') ); | |
if ($images) : | |
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 | |
/** | |
* Get a list of downloads | |
* | |
* Return an array of downloads suitable for CMB's select field. | |
* | |
* Example CMB select field usage: | |
* | |
* array( | |
* 'name' => 'Download', |
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
function ajax_get_latest_posts(){ | |
$attachments = get_children(array('post_parent' => $post->ID, | |
'post_status' => 'inherit', | |
'post_type' => 'attachment', | |
'post_mime_type' => 'image', | |
'order' => 'ASC', | |
'orderby' => 'menu_order ID')); | |
$allimagesizes = array(); | |
foreach($attachments as $att_id => $attachment) { |
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 | |
// Reduced to the minimum | |
class ThumbnailFilter extends FilterIterator | |
{ | |
private $wp_query; | |
public function __construct( Iterator $iterator, WP_Query $wp_query ) | |
{ | |
NULL === $this->wp_query AND $this->wp_query = $wp_query; | |
parent::__construct( $iterator ); |
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 | |
/** | |
* Settings | |
*/ | |
define('API_KEY', $_GET['apikey']); // CloudFlare API key | |
define('USERNAME', 'user@example.com'); // Email address used to login into CloudFlare | |
define('IP', getCurrentIP()); // Current IP address | |
echo 'Setting IP address to "' . IP . '"...<br />'; |
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
--- ddclient-3.8.1/ddclient 2011-07-11 15:04:21.000000000 -0600 | |
+++ ddclient 2013-10-30 19:51:54.056629680 -0600 | |
@@ -1,4 +1,3 @@ | |
-#!/usr/bin/perl -w | |
#!/usr/local/bin/perl -w | |
###################################################################### | |
# $Id: ddclient 130 2011-07-11 21:02:07Z wimpunk $ | |
@@ -13,12 +12,18 @@ | |
# Support for multiple IP numbers added by | |
# Astaro AG, Ingo Schwarze <ischwarze-OOs/4mkCeqbQT0dZR+AlfA@public.gmane.org> September 16, 2008 |
OlderNewer