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 Automatic Background Updates | |
* | |
* @link http://codex.wordpress.org/Configuring_Automatic_Background_Updates | |
* @link http://www.sitepoint.com/a-guide-to-updating-wordpress/ | |
*/ | |
// disable automatic updates | |
add_filter( 'automatic_updater_disabled', '__return_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 | |
/* | |
* Add Shortcode Select to WP Editor | |
*/ | |
function custom_shortcode_select() { | |
// display shortcode select only on edit screen | |
$screen = get_current_screen(); | |
if ( $screen != null && ( $screen->base == 'post' || $screen->base == 'edit-tags' ) ) { |
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 an array with all posts from specific post type | |
* | |
* @param string $post_type retrieves posts by Post Types | |
* | |
* @return array with post ID as a key and post title as a value | |
*/ | |
function get_posts_array( $post_type = 'post' ) { |
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 | |
/** | |
* Taxonomy template | |
* @link http://codex.wordpress.org/Class_Reference/WP_Query | |
*/ | |
// Protect against arbitrary paged values | |
$paged = ( get_query_var( 'paged' ) ) ? absint( get_query_var( 'paged' ) ) : 1; | |
$taxonomy = get_query_var( 'taxonomy' ); | |
$term = get_query_var( 'term' ); |
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 | |
/** | |
* Template to retrieve the terms in a taxonomy | |
* @link http://codex.wordpress.org/Function_Reference/get_terms | |
*/ | |
$terms = get_terms( 'section' ); | |
echo '<ul>'; |
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
jQuery( document ).ready( function ( $ ) { | |
var $pageTemplate = $( "#page_template" ), | |
$metaBoxID = $( "#meta_box_id" ); | |
$pageTemplate.on( "change", function () { | |
if ( $( this ).val() == "templates/page-custom.php" ) { | |
$metaBoxID.show(); | |
} else { | |
$metaBoxID.hide(); | |
} |
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
.font-fix { | |
-webkit-font-smoothing: antialiased; | |
-moz-osx-font-smoothing: grayscale; | |
text-rendering: optimizeLegibility; | |
} |
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
if (/android|webos|iphone|ipad|iemobile|windows phone|ipod|bb10|blackberry/i.test(navigator.userAgent.toLowerCase())) { | |
// Code goes here | |
} | |
/* | |
* Code from http://detectmobilebrowsers.com | |
* License: public domain | |
*/ | |
window.mobilecheck = function() { |
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 | |
/** | |
* limit_text_length | |
* Function to limit text length by characters. | |
* | |
* @param string $string | |
* @param int $length | |
* | |
* @return string | |
*/ |
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
/* thanks to: http://www.catswhocode.com/blog/manage-wordpress-comments-using-sql */ | |
/* Delete all spam comments */ | |
DELETE from wp_comments WHERE comment_approved = 'spam'; | |
/* Delete all comments between two dates */ | |
DELETE FROM wp_comments | |
WHERE comment_date > '2013-11-15 01:10:04' | |
AND comment_date <= '2013-11-20 00:10:04'; |
OlderNewer