This file contains hidden or 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 the following to "~/.ssh/config" file: | |
Host * | |
AddKeysToAgent yes | |
IdentityFile ~/.ssh/id_rsa | |
UseKeychain yes |
This file contains hidden or 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 | |
// Auto-populate Staff post title with ACF name field. | |
function efd_staff_post_title_updater($post_id) | |
{ | |
$my_post = array(); | |
$my_post['ID'] = $post_id; | |
if (get_post_type() == 'staff') { | |
$my_post['post_title'] = get_field('name'); // Update Title | |
$my_post['post_name'] = get_field('name'); // Update Slug |
This file contains hidden or 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( 'woocommerce_email_before_order_table', 'add_order_email_instructions', 10, 2 ); | |
function add_order_email_instructions( $order, $sent_to_admin ) { | |
$shipping_method = @array_shift( $order->get_shipping_methods() ); | |
$shipping_method_id = $shipping_method['method_id']; | |
if ( ! $sent_to_admin ) { |
This file contains hidden or 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 | |
// check if the repeater field has rows of data | |
if (have_rows('video_grid')): ?> | |
<div class="row"> | |
<div class="small-12 small-centered medium-10 columns"> | |
<ul class="small-block-grid-1 medium-block-grid-2"> | |
<?php | |
// loop through the rows of data | |
while (have_rows('video_grid')) : the_row(); |
This file contains hidden or 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
jQuery('iframe[src*="youtube.com"], iframe[src*="vimeo.com"]').each(function() { | |
if ( jQuery(this).innerWidth() / jQuery(this).innerHeight() > 1.5 ) { | |
jQuery(this).wrap("<div class='widescreen flex-video'/>"); | |
} else { | |
jQuery(this).wrap("<div class='flex-video'/>"); | |
} | |
}); |
This file contains hidden or 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
<!-- Begin custom tax loop --> | |
<ul class="accordion" data-accordion> | |
<?php | |
//Retrieve custom taxonomy terms using get_terms and the custom post type. | |
$categories = get_terms('state'); | |
//Iterate through each term | |
foreach ( $categories as $category ) : | |
?> |
This file contains hidden or 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 | |
// WP_Query arguments | |
$args = array ( | |
'post_type' => 'sermon', | |
'posts_per_page' => '12', | |
'post_parent' => 0 | |
); | |
// The Query |
This file contains hidden or 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 $level = count(get_post_ancestors( $post->ID )) + 1; // Finding out if we are on a child post | |
$postid = get_the_ID(); // Getting the id of the current post to find the post_parent below | |
switch($level) { | |
case 1: | |
// WP_Query arguments | |
$args = array ( | |
'post_type' => 'sermon', | |
'posts_per_page' => -1, | |
'post_parent' => $postid, |
This file contains hidden or 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 post types to archives | |
function namespace_add_custom_types( $query ) { | |
if( is_category() || is_tag() && empty( $query->query_vars['suppress_filters'] ) ) { | |
$post_types = get_post_types( '', 'names' ); | |
$query->set( 'post_type', $post_types); | |
return $query; | |
} | |
} |
This file contains hidden or 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 Soliloquy defaults. | |
*/ | |
add_filter( 'soliloquy_defaults', 'tgm_soliloquy_default_settings', 20, 2 ); | |
function tgm_soliloquy_default_settings( $defaults, $post_id ) { | |
$defaults['slider_width'] = 800; // Slider width. | |
$defaults['slider_height'] = 400; // Slider height. | |
$defaults['control'] = 0; // Turns navigation pagination off by default. |