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 | |
if (has_post_thumbnail()) { | |
$image_data = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), "large" ); | |
echo '<div class="page__featured-image" style="background-image: url('.$image_data[0].');"></div>'; | |
} | |
?> |
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 if (is_singular( 'cpt_opportunities' ) ) : | |
get_template_part('templates/page', 'header-opportunities'); | |
else : | |
get_template_part('templates/page', 'header'); | |
endif; | |
?> |
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
// http://codepen.io/alexcarpenter/pen/LveDx | |
html, body { | |
width: 100%; | |
height: 100%; | |
} | |
.bg-img { | |
width: 100%; | |
height: 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
// Alter Featured image box to say a gradient will be applied. | |
function new_post_thumbnail_meta_box() { | |
global $post; // we know what this does | |
echo '<p>' . 'A gradient overlay will be applied to this image' . '</p>'; | |
$thumbnail_id = get_post_meta( $post->ID, '_thumbnail_id', true ); // grabing the thumbnail id of the post | |
echo _wp_post_thumbnail_html( $thumbnail_id ); // echoing the html markup for the thumbnail | |
} | |
function render_new_post_thumbnail_meta_box() { |
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 | |
$tax = 'place_of_delivery'; | |
// Show all taxonomy terms | |
$tax_terms = wp_get_object_terms( $post->ID, $tax ); | |
if (!empty( $tax_terms )) : | |
echo '<ul>'; | |
foreach( $tax_terms as $term ) { | |
echo '<li><a href="' . get_term_link( $term->slug, $tax ) . '">' . $term->name . '</a></li>'; | |
} |
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 if(get_field('field')): the_field('field'); endif; ?> |
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
// fix non-https acf elements | |
function ssl_post_thumbnail_urls($url, $post_id) { | |
//Skip file attachments | |
if(!wp_attachment_is_image($post_id)) { | |
return $url; | |
} | |
//Correct protocol for https connections | |
list($protocol, $uri) = explode('://', $url, 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
<?php | |
global $current_user; | |
$userID = $current_user->ID; | |
$imageArray = get_field('your_picture', 'user_' . $userID); | |
$imageThumbURL = $imageArray['sizes']['thumbnail']; | |
?> | |
<img src="<?php echo $imageThumbURL;?>"> |
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
add_filter( 'manage_taxonomies_for_cpt_opportunities_columns', 'cpt_opportunities_columns' ); | |
function cpt_opportunities_columns( $taxonomies ) { | |
$taxonomies[] = 'area_of_study'; | |
$taxonomies[] = 'area_of_interest'; | |
return $taxonomies; | |
} |
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
// Conditionally enqueue IE stylesheets | |
// http://wpbeaches.com/register-enqueue-internet-explorer-css-style-sheets-wordpress/ | |
function ie_style_sheets () { | |
wp_register_style( 'ie8', get_stylesheet_directory_uri() . '/css/ie8.css' ); | |
$GLOBALS['wp_styles']->add_data( 'ie8', 'conditional', 'lte IE 8' ); | |
wp_register_style( 'ie7', get_stylesheet_directory_uri() . '/css/ie7.css' ); | |
$GLOBALS['wp_styles']->add_data( 'ie7', 'conditional', 'lte IE 7' ); | |
wp_enqueue_style( 'ie8' ); |