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
/* ======================================================================================================================== | |
ACF vs iThemes Exchange Quick Fix | |
======================================================================================================================== */ | |
add_action('admin_head', 'acf_exchange_fix'); | |
function acf_exchange_fix() { | |
echo "<style> |
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
transform:translateY(-50%); | |
-ms-transform:translateY(-50%); /* IE 9 */ | |
-moz-transform:translateY(-50%); /* Firefox */ | |
-webkit-transform:translateY(-50%); /* Safari and Chrome */ | |
-o-transform:translateY(-50%); /* Opera */ |
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_filter( 'embed_oembed_html', 'tdd_oembed_filter', 10, 4 ) ; | |
function tdd_oembed_filter($html, $url, $attr, $post_ID) { | |
$return = '<div class="flex-video">'.$html.'</div>'; | |
return $return; | |
} |
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
/* ======================================================================================================================== | |
Gallery and Auto Featured Image | |
======================================================================================================================== */ | |
function fix_my_gallery_wpse43558($output, $attr) { | |
global $post; |
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
function my_cdn_upload_url() { | |
return 'http://static.domain.com/content/uploads'; | |
} | |
add_filter( 'pre_option_upload_url_path', 'my_cdn_upload_url' ); |
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 | |
$gallery = get_field('images'); | |
$rand = array_rand($gallery, 1); | |
if( $gallery ): ?> | |
<img src="<?php echo $gallery[$rand]['sizes']['large']; ?>" alt="<?php echo $gallery[$rand]['alt']; ?>" /> | |
<?php endif; ?> |
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
wp_deregister_script('jquery'); | |
wp_register_script('jquery', "http" . ($_SERVER['SERVER_PORT'] == 443 ? "s" : "") . "://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js", false, null); | |
wp_enqueue_script('jquery'); |
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
function wpa60888_attachment_link( $link, $id ){ | |
return home_url() . '/?attachment_id=' . $id; | |
} | |
add_filter( 'attachment_link', 'wpa60888_attachment_link', 10, 2 ); |