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 | |
/* | |
Splashscreening: for KUHF.org Pubradio Pledge Drive: | |
*/ | |
// Splash Page Display for Campaign | |
$current = time(); | |
if ($current <= mktime(5, 0, 0, 4, 4, 2011) || $current >= mktime (12, 0, 0, 4, 15, 2011)) | |
//if current time is earlier than 5am on 4/4/2011, or later than noon on 4/15/2011, then ignore this code | |
{ |
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 | |
/* | |
Twitter Chat Archive: | |
Get hashtag results from Twitter Search API (in JSON) for a weekly chat. | |
API takes date range via values: 'since' thru 'until' (YYYY-MM-DD). | |
API limits: 1 page per request, 100 results per page, 1500 total results: <7 days old. | |
Script below: Repeats page requests until no results found w/in date-range. | |
Then gathers only those results w/in specified timestamp range. | |
Then sort results from oldest to newest. |
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
/* Pages dropdown widget" */ | |
// Based on WP_Widget_Pages class in /wp-includes/default-widgets.php | |
class Hearvox_Widget_Pages_Dropdown extends WP_Widget { | |
/** | |
* Register widget with WordPress. | |
*/ | |
function __construct() { | |
parent::__construct( | |
'hearvox_pages_dropdown', // Base 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 | |
/** | |
* Use filemod timestamp for version number. | |
* | |
* For setting cache-busting version number in script registrations. | |
* wp_register_script( 'handle', $file_url, array(), filemod_vers( $file_path ) ); | |
* | |
* @param string $path Path of script/style file | |
* @return string $vers File-modification timestamp or WordPress version | |
*/ |
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
/* Jetpack gallery: hide meta and comment form */ | |
.jp-carousel-image-meta, | |
#jp-carousel-comment-form-container, | |
#jp-carousel-comment-form { | |
display: none; | |
} |
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 | |
/* Update postdate for all post in a category */ | |
// Get IDs of all posts in a category. | |
$args = array( | |
'category_name' => 'cat-name', | |
'fields' => 'ids', | |
); | |
$query = new WP_Query($args); | |
// Update meta for all IDs. |
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 debug globals (goes in wp-config.php). | |
* For Dev sites only! | |
* @ link https://premium.wpmudev.org/blog/debugging-wordpress-how-to-use-wp_debug/ | |
*/ | |
// Turn debugging on. | |
define( 'WP_DEBUG', true ); | |
// Log PHP error messages to file: /wp-content/debug.log | |
define( 'WP_DEBUG_LOG', true ); |
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_images_args = array( | |
'post_type' => 'attachment', | |
'post_status' => 'inherit', | |
'posts_per_page' => -1, | |
); | |
$query_images = new WP_Query( $query_images_args ); | |
$image_sizes = get_intermediate_image_sizes(); | |
$image_sizes[] = 'full'; |
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 | |
/* Use Yoast SEO's Primary Category feature only on Categories. */ | |
function myprefix_yoast_primary_tax( $all_taxonomies ) { | |
$args = array( 'name' => 'category' ); | |
$all_taxonomies = get_taxonomies( $args, 'objects' ); | |
return $all_taxonomies; | |
} | |
add_filter('wpseo_primary_term_taxonomies', 'myprefix_yoast_primary_tax' ); | |
?> |
OlderNewer