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 | |
/** | |
* Hide editor on specific pages. | |
* | |
*/ | |
add_action( 'admin_init', 'hide_editor' ); | |
function hide_editor() { | |
// Get the Post 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 | |
// Customized the comment form fields ( not the comment text area ) | |
add_filter('comment_form_default_fields', 'my_comment_form_args'); | |
// Customizes the text area - you have to do this here, rather than in comment_form_default_fields | |
add_filter('comment_form_field_comment', 'my_comment_form_field_comment'); | |
// Customized the comment notes above the form fields | |
add_filter( 'comment_form_defaults', 'my_comment_form_defaults' ); |
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
## Run this in phpMyadmin | |
## | |
## Cleans up Posts table | |
UPDATE wp_posts SET post_content = REPLACE(post_content, '“', '“'); | |
UPDATE wp_posts SET post_content = REPLACE(post_content, 'â€', '”'); | |
UPDATE wp_posts SET post_content = REPLACE(post_content, '’', '’'); | |
UPDATE wp_posts SET post_content = REPLACE(post_content, '‘', '‘'); | |
UPDATE wp_posts SET post_content = REPLACE(post_content, '—', '–'); | |
UPDATE wp_posts SET post_content = REPLACE(post_content, '–', '—'); | |
UPDATE wp_posts SET post_content = REPLACE(post_content, '•', '-'); |
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 Extra Profile Meta fields to WordPress user profile | |
*/ | |
//Extra Author Profile Meta | |
add_action( 'show_user_profile', 'my_show_extra_profile_fields' ); | |
add_action( 'edit_user_profile', 'my_show_extra_profile_fields' ); | |
function my_show_extra_profile_fields( $user ) { ?> | |
<h3>Is this an active author?</h3> |
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($){ | |
$('h2.title').html(function(){ | |
// separate the text by spaces | |
var text= $(this).text().split(' '); | |
// drop the last word and store it in a variable | |
var last = text.pop(); | |
// join the text back and if it has more than 1 word add the span tag | |
// to the last word | |
return text.join(" ") + (text.length > 0 ? ' <span class="last">'+last+'</span>' : last); |
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 bk_is_naked_day($d) { | |
$start = date('U', mktime(-12, 0, 0, 04, $d, date('Y'))); | |
$end = date('U', mktime(36, 0, 0, 04, $d, date('Y'))); | |
$z = date('Z') * -1; | |
$now = time() + $z; | |
if ( $now >= $start && $now <= $end ) { | |
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 a taxonomy query to pre_get_posts to remove Quote post formats from the main query | |
* | |
* @author Pat Ramsey | |
* @link http://slash25.com | |
* | |
* @param array tax_query $args | |
* @return modified $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
<?php | |
// Filter Yoast Meta Priority | |
function move_yoast_seo_box() { | |
if ( defined( 'WPSEO_VERSION' ) ) : | |
add_filter( 'wpseo_metabox_prio', function() { return 'low'; } ); | |
endif; | |
} | |
add_action('admin_init', 'move_yoast_seo_box'); | |
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
// CSS for this can be found here: https://gist.github.com/3827867 | |
jQuery(document).ready(function($){ | |
// Add classes to the labels of selects, text-inputs, email inputs and textareas | |
$('.infusion-form .infusion-field select').prev('label').addClass('label-select'); | |
$('.infusion-form .infusion-field input[type="email"], .infusion-form .infusion-field input[type="text"], .infusion-form .infusion-field textarea').prev('label').addClass('label-placeholder'); | |
$('.infusion-form .infusion-field input[type="email"], .infusion-form .infusion-field input[type="text"], .infusion-form .infusion-field textarea').focus(function(){ | |
$(this).prev('.infusion-field .label-placeholder').hide(); |
NewerOlder