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( 'wp_set_comment_status', 'wi_comment_notification', 99, 2 ); | |
function wi_comment_notification( $comment_id, $comment_status ){ | |
$comment_object = get_comment( $comment_id ); | |
if( $comment_status == 'approve' && $comment_object->comment_parent > 0 ){ | |
$comment_parent = get_comment( $comment_object->comment_parent ); | |
$mailcontent = 'Hi ' . $comment_parent->comment_author . ',<br><br>'; | |
$mailcontent .= $comment_object->comment_author . ' replied to your comment on <a href="' . get_permalink( $comment_parent->comment_post_ID ) . '">' . get_the_title( $comment_parent->comment_post_ID ).'</a> with the following:'; | |
$mailcontent .= '<blockquote>' . $comment_object->comment_content . '</blockquote>'; |
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 | |
/* | |
* Send visitors who submit events to a different page after submission. | |
* | |
* This actually does the redirect. If an event was submitted, and we're about | |
* to reload the submission page (with a message instead of a form), this will | |
* redirect the user. | |
* | |
* @param WP $wp | |
* @return void |
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
<!-- | |
The js code snippet below should be placed in the confirmation text for a Gravity Form that does not send to a thank you | |
page on submission, such as a sidebar or footer email newsletter signup form. | |
* This snippet will work for forms that submit via both ajax and non-ajax. | |
* This snippet will work with plugins such as Google Analytics for WordPress by MonsterInsights. | |
* This snippet will work for Universal Analytics, but not Classic Analytics. | |
You can read more about tracking pageviews at https://developers.google.com/analytics/devguides/collection/analyticsjs/pages. | |
--> |
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 | |
//Created using code from http://scottjehl.github.io/picturefill/, | |
//http://ericportis.com/posts/2014/srcset-sizes/, | |
//http://www.taupecat.com/2014/05/picturefill-js-wordpress/, | |
//http://www.smashingmagazine.com/2014/05/12/picturefill-2-0-responsive-images-and-the-perfect-polyfill/ | |
//For homepage where featured image should live | |
if( has_post_thumbnail() ){ | |
$thumbnail_id = get_post_thumbnail_id(); | |
$alt = get_post_meta( $thumbnail_id, '_wp_attachment_image_alt', true ); |
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 custom query vars to handle Google Analytics Ecommerce tracking. | |
* This should be placed in a plugin or in functions.php of the theme. | |
* | |
* You'll want to use the redirect method for Gravity Forms confirmations and | |
* turn on passing field data via a query string. An example we used was: | |
* donation_amount={Donation Amount:13}&donation_id={entry_id}&donation_recurring=0 | |
*/ | |
function sm_add_query_vars( $vars ){ |
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 | |
/* | |
* Display all the board members for the Nonprofit Board Management plugin | |
* using a shortcode. | |
* | |
* Copy and paste this code into your functions.php file to use it. | |
* | |
* example for use on a page: [list_board_members] | |
*/ | |
function wi_list_board_members(){ |
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
//Set up the color pickers to work with our text input field | |
jQuery( document ).ready(function(){ | |
"use strict"; | |
//This if statement checks if the color picker widget exists within jQuery UI | |
//If it does exist then we initialize the WordPress color picker on our text input field | |
if( typeof jQuery.wp === 'object' && typeof jQuery.wp.wpColorPicker === 'function' ){ | |
jQuery( '#color' ).wpColorPicker(); | |
} | |
else { |
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
<input id="color" name="color_options[color]" type="text" value="" /> | |
<div id="colorpicker"></div> |
NewerOlder