This file contains hidden or 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 remove_jetpack_styles(){ | |
wp_deregister_style('AtD_style'); // After the Deadline | |
wp_deregister_style('jetpack-carousel'); // Carousel | |
wp_deregister_style('grunion.css'); // Grunion contact form | |
wp_deregister_style('the-neverending-homepage'); // Infinite Scroll | |
wp_deregister_style('infinity-twentyten'); // Infinite Scroll - Twentyten Theme | |
wp_deregister_style('infinity-twentyeleven'); // Infinite Scroll - Twentyeleven Theme | |
wp_deregister_style('infinity-twentytwelve'); // Infinite Scroll - Twentytwelve Theme | |
wp_deregister_style('noticons'); // Notes |
This file contains hidden or 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 test_if_meta($arr, $key, $before = '', $after = '') { | |
if ($text = $arr[$key][0]) | |
return $before . $text . $after; | |
} | |
This file contains hidden or 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 my_recent_posts_shortcode( $atts ) { | |
extract( shortcode_atts( array( 'limit' => 5 ), $atts ) ); | |
$q = new WP_Query( 'posts_per_page=' . $limit ); | |
$list = '<ul class="recent-posts">'; | |
while ( $q->have_posts() ) { | |
$q->the_post(); |
This file contains hidden or 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('admin_head', 'my_custom_fonts'); | |
function my_custom_fonts() { | |
echo '<style> | |
#breedsdiv {display:none;} | |
</style>'; | |
} | |
This file contains hidden or 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 (is_admin()) { | |
add_action( 'init', 'cmb_showcase_load_metabox' ); | |
} | |
function cmb_showcase_load_metabox() { | |
require_once( 'includes/metabox/example-functions.php' ); | |
require_once( 'includes/metabox/init.php' ); |
This file contains hidden or 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 my_custom_save_post( $post_id ) { | |
// do stuff here | |
} | |
add_action( 'save_post_membros', 'my_custom_save_post' ); |
This file contains hidden or 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('widget_posts_args','modify_widget'); | |
function modify_widget() { | |
$r = array( 'cat' => '6' ); | |
return $r; | |
} |
This file contains hidden or 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
<ul> | |
<?php | |
global $wpdb; | |
$limit = 0; | |
$year_prev = null; | |
$months = $wpdb->get_results("SELECT DISTINCT MONTH( post_date ) AS month , YEAR( post_date ) AS year, COUNT( id ) as post_count FROM $wpdb->posts WHERE post_status = 'publish' and post_date <= now( ) and post_type = 'post' GROUP BY month , year ORDER BY post_date DESC"); | |
foreach($months as $month) : | |
$year_current = $month->year; | |
if ($year_current != $year_prev){ | |
if ($year_prev != null){?> |
NewerOlder