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 | |
## Copy/paste the below code into your theme's functions.php file or a new plugin. | |
add_filter( 'regenerate_thumbs_cap', function( $capability ) { | |
// See https://codex.wordpress.org/Roles_and_Capabilities | |
return 'upload_files'; | |
} ); |
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 | |
/** | |
* Copy paste the below code into your theme's functions.php file. | |
* You could add it to a plugin instead, but it's just easier to | |
* add it to your theme's functions.php. The only drawback to this | |
* is if you switch themes, this functionality will stop working. | |
* | |
* --Alex Mills | |
* Questions? Contact me: http://www.viper007bond.com/contact/ |
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_filter( 'shortcode_atts_gallery', 'sheri_galleries_default_to_four_columns', 10, 3 ); | |
function sheri_galleries_default_to_four_columns( $atts, $defaults, $raw_atts ) { | |
// Don't override manually-set number of columns | |
if ( ! empty( $raw_atts['columns'] ) ) { | |
return $atts; | |
} |
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 ( !function_exists( 'wpcom_vip_load_category_base' ) ): | |
/** | |
* Enables a custom or no category base, if the site wants to use one that's not the WP.com default (/category/) | |
* | |
* Usage: | |
* wpcom_vip_load_category_base( '' ); | |
* wpcom_vip_load_category_base( 'section' ); | |
* |
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 | |
/** | |
* This little class records how long it takes each WordPress action or filter | |
* to execute which gives a good indicator of what hooks are being slow. | |
* You can then debug those hooks to see what hooked functions are causing problems. | |
* | |
* This class does NOT time the core WordPress code that is being run between hooks. | |
* You could use similar code to this that doesn't have an end processor to do that. | |
* |
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 | |
$my_query = new WP_Query( array( | |
'category__in' => array( 1, 2, 3 ), | |
'posts_per_page' => 10, | |
) ); |
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_action( 'plugins_loaded', 'tomnelseon_remove_birchschedule_hook' ); | |
function tomnelseon_remove_birchschedule_hook() { | |
global $birchschedule; | |
remove_action( 'wp_ajax_birs_get_avaliable_time', array( $birchschedule->shortcode, 'ajax_get_avaliable_time' ) ); | |
} |
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 | |
class WP_Widget_Text_HTML_In_Title extends WP_Widget { | |
function __construct() { | |
$widget_ops = array( 'classname' => 'widget_text_html_in_title', 'description' => 'Arbitrary text or HTML. Allows HTML in title field.' ); | |
$control_ops = array( 'width' => 400, 'height' => 350 ); | |
parent::__construct( 'text-html-in-title', 'Text (Allows HTML In Title)', $widget_ops, $control_ops ); | |
} |
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 | |
$current_category = get_queried_object(); | |
if ( $current_category->category_parent ) { | |
$parent_category = get_category( $current_category->category_parent ); | |
$parent = $parent_category->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
<?php | |
add_filter( 'embed_oembed_html', 'blogsuccessjrnl_youtube_autoplay', 10, 4 ); | |
function blogsuccessjrnl_youtube_autoplay( $html, $url, $attr, $post_ID ) { | |
// Abort if not in a single-post view. You don't want these auto-playing on you homepage. | |
if ( ! is_singular() ) | |
return $html; |
NewerOlder