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(function_exists("register_field_group")) | |
{ | |
register_field_group(array ( | |
'id' => 'acf_post-list-options', | |
'title' => 'Post List Options', | |
'fields' => array ( | |
array ( | |
'key' => 'field_543f8a046d65e', | |
'label' => 'Authors', | |
'name' => 'authors', |
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 my_editor_styles() { | |
add_editor_style( 'admin/editor.css' ); | |
} | |
add_action( 'after_setup_theme', 'my_editor_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
global $wpdb; | |
for( $i=1; $i <= 5; $i++ ) { | |
$this_week = 7 * $i; | |
$last_week = 7 * ( $i - 1); | |
$comment_counts[] = | |
$wpdb->get_var( "SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_date > '" . date('Y-m-d H:i:s', strtotime('-' . $this_week . ' days')) . "' AND comment_date < '" . date('Y-m-d H:i:s', strtotime('-' . $last_week . ' days')) . "'" ) ; |
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 my_code_output( $atts, $content ) { | |
return '<pre><code>' . $content . '</code></pre>'; | |
} | |
add_shortcode('code', 'my_code_output'); |
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 user_edit_script( $hook ) { | |
if ( 'profile.php' != $hook ) { | |
return; | |
} | |
wp_enqueue_script( 'my-user-edit', plugin_dir_url( __FILE__ ) . 'js/my-user-edit.js' ); | |
} | |
add_action( 'admin_enqueue_scripts', 'user_edit_script' ); |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "precise64" | |
config.vm.box_url = "http://files.vagrantup.com/precise64.box" | |
config.vm.network :private_network, ip: "192.168.77.77" | |
config.vm.provision :shell, :path => "install.sh" |
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
#!/bin/bash | |
# Setup Variables | |
DBNAME=blog | |
DBUSER=root | |
DBPASS=root | |
DBHOST=localhost | |
DBPREFIX=9239jej9md_ | |
URL=http://blog.local |
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 theme_slug_setup() { | |
add_theme_support( 'title-tag' ); | |
} | |
add_action( 'after_setup_theme', 'theme_slug_setup' ); | |
if ( ! function_exists( '_wp_render_title_tag' ) ) : | |
function theme_slug_render_title() { | |
echo '<title>' . wp_title( '|', false, 'right' ) . "</title>\n"; | |
} | |
add_action( 'wp_head', 'theme_slug_render_title' ); |
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
$query = new WP_Query( array( | |
'meta_query' => array( | |
'relation' => 'OR', | |
array( | |
'relation' => 'AND', | |
array( | |
'key' => 'city', | |
'value' => 'Miami', | |
), | |
array( |
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
add_action( 'init', 'create_athlete_taxonomy' ); | |
function create_athlete_taxonomy() { | |
$labels = array( | |
'name' => 'Athletes', | |
'singular_name' => 'Athlete', | |
'search_items' => 'Search Athletes', | |
'all_items' => 'All Athletes', | |
'edit_item' => 'Edit Athlete', | |
'update_item' => 'Update Athlete', |
OlderNewer