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 "Click to enlarge image" under procuct thumbnail on single product page | |
add_action( 'woocommerce_product_thumbnails', 'woocommerce_click_to_enlarge', 10 ); | |
function woocommerce_click_to_enlarge() { | |
echo '<a itemprop="image" href="'; | |
echo wp_get_attachment_url( get_post_thumbnail_id() ); | |
echo '" class="zoom" rel="thumbnails" title="'; | |
echo get_the_title( get_post_thumbnail_id() ); | |
echo '">Click to enlarge image</a>'; | |
} |
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( 'init', 'cd_add_editor_styles' ); | |
/** | |
* Apply theme's stylesheet to the visual editor. | |
* | |
* @uses add_editor_style() Links a stylesheet to visual editor | |
* @uses get_stylesheet_uri() Returns URI of theme stylesheet | |
*/ | |
function cd_add_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
// enable | |
add_filter( 'woocommerce_ship_to_different_address_checked', '__return_true' ); | |
//disable | |
add_filter( 'woocommerce_ship_to_different_address_checked', '__return_false' ); |
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('set_current_user', 'xmit_hide_admin_bar'); | |
function xmit_hide_admin_bar() { | |
if (!current_user_can('edit_posts')) { | |
show_admin_bar(false); | |
} | |
} | |
?> |
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 our custom image sizes | |
add_image_size( 'Featured Image', '350', '200', array( "1", "") ); | |
add_image_size( 'slider', '1148', '400', array( "1", "") ); | |
add_image_size( 'department-slider', '810', '360', false ); | |
add_image_size( 'featured-image', '350', '200', false ); | |
// Add custom image sizes to Media insertion dropdown menu | |
/*add_filter('image_size_names_choose', 'xmit_image_sizes'); | |
function xmit_image_sizes($sizes) { |
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 | |
/** | |
* Remove standard image sizes so that these sizes are not created during the Media Upload process | |
* | |
* @param $sizes, array of default images | |
* @return $sizes, new array of images | |
*/ | |
function cn_image_sizes( $sizes) { | |
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 bar background colors | |
--------------------------------------------- */ | |
.color1 { | |
background-color:rgba(0,175,170,.65); /* teal */ | |
} | |
.color2 { | |
background-color:rgba(110,205,178,.65); /* mint */ | |
} | |
.color3 { | |
background-color:rgba(107,163,185,.65); /* blue */ |
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 get_header(); ?> | |
<?php | |
// display user's selected header image; if not chosen, display generic header image | |
// header image is 2000px x 900px minimum | |
$header_image = get_field('post_header_image'); | |
if( !empty($header_image) ): ?> | |
<div class="xmit-page-header" style="background-image: url(<?php echo $header_image['url']; ?>);"> | |
<?php elseif (empty($header_image)): ?> |
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 user's selected header image; if not chosen, display generic header image | |
// header image is 2000px x 900px minimum | |
$header_image = get_field('post_header_image'); | |
if( !empty($header_image) ): ?> | |
<div class="xmit-page-header" style="background-image: url(<?php echo $header_image['url']; ?>);"> | |
<?php elseif (empty($header_image)): ?> | |
<div class="xmit-page-header" style="background-image:url(<?php bloginfo('stylesheet_directory');?>/images/generic-header.jpg);"> | |
<?php endif; |