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 the default notification email address for new forms | |
// ------------------------------------------------------------------------------ | |
add_action( 'gform_after_save_form', 'rkt_set_default_notification_to', 10, 2 ); | |
function rkt_set_default_notification_to( $form, $is_new ) { | |
// Using an ACF options field to allow the user to set this. | |
$admin_email = get_field( 'default_admin_email', 'option' ); |
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
<h1>This is the H1 Heading</h1> | |
Above this paragraph should be the H1 heading for your web page. If it is not visible, the design settings for the H1 tag is set to <code>display:none</code> which many WordPress Themes use to hide the blog title text and replace it with a graphic. Do not use H1 within your blog post area. | |
If the design in the H1 heading looks like your blog title or blog post title, then that is the style set for that HTML tag and you should not use it within your blog post area. | |
Inside of this test data section are most of the basic HTML and XHTML and CSS styles that you might use within your WordPress Theme. You need to know what that will look like as part of structuring your styles. | |
<h2>This is the H2 Heading</h2> | |
Above this paragraph should be the H2 heading for your web page. WordPress Themes use the h2 heading for various purposes. Logically, it should be either the post title or the first heading in the post content. | |
However, it is used all over WordPress Themes including the subtit |
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
// Then all you need to do is create a checkbox with the CSS class "fill-check," give the fields you want to fill from the class "fill-from," and give the fields you want to fill into the class "to-fill" (classes can be added under the "appearance" tab on forms). As long as the labels for the fields are the same, it should work. | |
//bind the click function | |
$(document).on('click', '.fill-check input', function() { | |
if($(this).is(':checked')) { | |
//put in the selectors we fill from | |
var fill_from = $('.fill-from, .fill-from .name_last, .fill-from .name_first, .fill-from .address_line_1, .fill-from .address_line_2, .fill-from .address_city, .fill-from .address_state, .fill-from .address_zip, .fill-from .address_country'); | |
fill_from.each(function() { |
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
let vimeoPlayers = {}; | |
function initVideoPlayers(){ | |
// console.log('initVideoPlayers called'); | |
jQuery(function($) { | |
vimeoPlayers = {}; |
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
// Get a responsive image based on an attachment ID | |
// ------------------------------------------------------------------------------ | |
function rkt_get_responsive_image($image_id, $image_size = 'large', $lazyload = false, $echo = true) { | |
if ( $image_id ) : | |
$image_alt = get_post_meta( $image_id, '_wp_attachment_image_alt', true ); | |
$image_args = 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
<?php | |
add_action( 'wp_ajax_kdm-pagination-load-posts', 'kdm_pagination_load_posts' ); | |
add_action( 'wp_ajax_nopriv_kdm-pagination-load-posts', 'kdm_pagination_load_posts' ); | |
function kdm_pagination_load_posts() { | |
global $wpdb; | |
// Set default variables | |
$msg = ''; |
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 you are using MAMP for your local WordPress or PHP development on a Mac, you likely need to import huge MySQL database dump files (more then 32Mb) in your local environment. | |
You could increase the size of maximum uploads in your php.ini file, however if the dump is really big (over 100Mb), the operation can take ages to complete. | |
It is more covenient to do this using the command line, expecially since it’s just a one liner. | |
mysql -u {DB_USER_NAME} -p {DB_NAME} < {PATH/TO/MYSQL/DUMP/FILE.SQL} | |
Keep in mind that the default user for MySQL as set by MAMP is root with a password of root, and that you need the full path to MAMP binaries to run the mysql command on a default installation. The command becomes: |
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
@mixin aspect-ratio($width, $height) { | |
position: relative; | |
&:before { | |
display: block; | |
content: ""; | |
width: 100%; | |
padding-top: ($height / $width) * 100%; | |
} | |
} |
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
@mixin cover($pos:absolute,$inset:0px) { | |
position: $pos; | |
bottom: $inset; | |
left: $inset; | |
right: $inset; | |
top: $inset; | |
width: calc(100% - (#{$inset} * 2)); | |
height: calc(100% - (#{$inset} * 2)); | |
} |
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
$browser-context: 16; | |
@function em($pixels, $context: $browser-context) { | |
@if (unitless($pixels)) { | |
$pixels: $pixels * 1px; | |
} | |
@if (unitless($context)) { | |
$context: $context * 1px; | |
} |
NewerOlder