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 show_most_recent_comment($post_id) { | |
$args = array( | |
'number' => '1', | |
'post_id' => $post_id, | |
); | |
$comments = get_comments($args); | |
foreach($comments as $comment) : | |
echo($comment->comment_author . '<br>' . $comment->comment_content. '<br>' .$comment->comment_date); | |
endforeach; | |
} |
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
/** | |
Piklist Create Custom Post Types | |
Creates Portfolio Items, Clients and Prospects | |
*/ | |
add_filter('piklist_post_types', 'automaton_post_types'); | |
function automaton_post_types($post_types) | |
{ | |
$post_types = array_merge($post_types, array( | |
'portfolio' => 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
//replace 72 below with your form id number | |
add_filter( 'gform_pre_render_72', 'populate_posts' ); | |
add_filter( 'gform_pre_validation_72', 'populate_posts' ); | |
add_filter( 'gform_pre_submission_filter_72', 'populate_posts' ); | |
add_filter( 'gform_admin_pre_render_72', 'populate_posts' ); | |
function populate_posts( $form ) { |
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
/* | |
Title: My Metabox | |
Description: My cool new metabox | |
Post Type: my_post_type | |
//if using a custom post type, enter the name of the post type above | |
*/ | |
//field starts | |
piklist('field', array( | |
'type' => 'text' |
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
.aurora-borealis { | |
background: linear-gradient(#05051f, #05051f, #97f7f3, #05051f, #05051f, #05051f, #76f6bd, #aaebc9, #05051f, #05051f, #69c1ff, #cb304f, #05051f, #05051f, #05051f, #05051f, #4a5b8f, #419f91, #05051f, #05051f, #3a4aa1, #db3b69, #05051f); | |
background-size: 1800% 1800%; | |
-webkit-animation: Aurora 180s ease; | |
-moz-animation: Aurora 180s ease; | |
animation: Aurora 180s ease; | |
animation-iteration-count: 1; | |
} | |
@-webkit-keyframes Aurora { |
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
'edit_columns' => array( | |
'title' => __('Client Name') | |
,'author' => __('Assigned to') | |
,'client_email' => __('Email Address') | |
,'client_phone' => __('Phone Number') |
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 populate_custom_fields_in_post_list_view ($column_name, $id ) { | |
global $post; | |
$email = get_post_meta( $post->ID, 'automaton_client_email', true); | |
switch ($column_name) { | |
case 'client_email': | |
echo email_template($email); | |
break; | |
case 'client_phone': |
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 email_template($email) { | |
global $wp_query, $post; | |
$welcome_email = "<a href=mailto:$email?Subject=Thank%20You%20for%20your%20Inquiry&body=I%20will%20review%20your%20needs%20and%20get%20back%20to%20you%20with%20an%20estimate%20in%20the%20next%2048%20hours.%0A%0AWe%20look%20forward%20to%20speaking%20with%20you%20soon.>$email</a>"; | |
$estimate_follow_up = "<a href=mailto:$email?Subject=Estimate%20Follow%20Up&body=I%20wanted%20to%20follow%20up%20on%20the%20estimate%20I%20sent%20over%20a%20few%20days%20ago%20and%20see%20if%20you%20had%20any%20questions.%20When%20is%20a%20good%20time%20for%20us%20to%20get%20on%20the%20phone%20and%20go%20over%20it%20together?%0A%0AYou%Thanks,>$email</a>"; | |
$general_follow_up = "<a href=mailto:$email?Subject=Following%20Up>$email</a>"; | |
if (in_category('new-lead')) : |
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
// Define a constant path to plugin folder | |
define(SINGLE_PATH, plugin_dir_path( __FILE__ ). '/templates'); | |
// Filter the single_template with our custom function | |
add_filter('single_template', 'my_single_template'); | |
function my_single_template($single) { | |
global $wp_query, $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
function get_custom_field($field) { | |
global $post; | |
$value = get_post_meta($post->ID, $field, true); | |
if ($value) return esc_attr( $value ); | |
else return false; | |
} |
OlderNewer