🏄♂️
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 Name: Archives | |
*/ | |
?> | |
<?php get_header(); ?> | |
<h2><?php $numposts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_status = 'publish'"); | |
if (0 < $numposts) $numposts = number_format($numposts); ?> |
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_day = date('j'); | |
$last_year = date('Y')-1; | |
query_posts('day='.$current_day.'&year='.$last_year); | |
if (have_posts()): | |
while (have_posts()) : the_post(); | |
the_title(); | |
the_excerpt(); | |
endwhile; | |
endif; |
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_posts('meta_key=review_type&meta_value=movie'); ?> | |
<?php if (have_posts()) : ?> | |
<?php while (have_posts()) : the_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 | |
query_posts('showposts=8'); | |
$ids = array(); | |
while (have_posts()) : the_post(); | |
$ids[] = get_the_ID(); | |
the_title(); | |
the_content(); | |
endwhile; | |
?> |
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 filter_where($where = '') { | |
$where .= " AND post_date >= '2009-03-17' AND post_date <= '2009-05-03'"; | |
return $where; | |
} | |
add_filter('posts_where', 'filter_where'); | |
query_posts($query_string); | |
while (have_posts()) : | |
the_post(); | |
the_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
// Allow SVG files to be uploaded to the media library | |
add_filter( 'wp_check_filetype_and_ext', function($data, $file, $filename, $mimes) { | |
global $wp_version; | |
if ( $wp_version !== '4.7.1' ) { | |
return $data; | |
} | |
$filetype = wp_check_filetype( $filename, $mimes ); |
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
function register_my_custom_menu_page() { | |
add_menu_page( 'Page Title', 'Menu Title', 'manage_options', '../wp-content/themes/index.html', '', 'dashicons-book', 3 ); | |
} | |
add_action( 'admin_menu', 'register_my_custom_menu_page' ); |
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
// Remove jQuery Migrate Script from header and Load jQuery from Google API | |
function crunchify_stop_loading_wp_embed_and_jquery() { | |
if (!is_admin()) { | |
wp_deregister_script('wp-embed'); | |
wp_deregister_script('jquery'); // Bonus: remove jquery too if it's not required | |
} | |
} | |
add_action('init', 'crunchify_stop_loading_wp_embed_and_jquery'); |
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
// Remove WP Emoji | |
remove_action('wp_head', 'print_emoji_detection_script', 7); | |
remove_action('wp_print_styles', 'print_emoji_styles'); | |
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' ); | |
remove_action( 'admin_print_styles', 'print_emoji_styles' ); |
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
/*///////////////////////////////////////// | |
/// MEDIA QUERIES | |
*///////////////////////////////////////// | |
/** | |
* Mixins for defining media queries. These mixins should always be used | |
* to define media query breakpoints. | |
*/ | |
@mixin bp-min-width($width) { |
NewerOlder