Skip to content

Instantly share code, notes, and snippets.

@jdembowski
Created September 30, 2015 14:13
Show Gist options
  • Save jdembowski/d4243f8e1756fb03e709 to your computer and use it in GitHub Desktop.
Save jdembowski/d4243f8e1756fb03e709 to your computer and use it in GitHub Desktop.
<?php
/*
Plugin Name: Phantom 3D
Plugin URI: http://blog.dembowski.net/2012/02/12/now-in-3d/
Description: This plugin wraps posted tagged with "Phantom 3D" in a div that applies red-blue to the text for an old fashioned 3D effect.
Author: Jan Dembowski
Version: 1.0
Author URI: http://blog.dembowski.net/
*/
add_filter( 'wp_head' , 'mh_3D_style' );
add_filter( 'the_content' , 'mh_3D_content' );
function mh_3D_style() { ?>
<!-- Phantom 3D -->
<style>
.redblue-text p {
color:rgba(0,204,255,0.7);
text-shadow: rgba(255,0,0,0.9) -3px 0px 0px;
padding-left: 4px;
}
.redblue-text a {
color:rgba(255,0,0,0.9);
text-shadow: rgba(0,204,255,0.7) -3px 0px 0px;
padding-left: 4px;
}
</style>
<!-- /Phantom 3D -->
<?php }
function mh_3D_content( $content ) {
if ( has_tag( 'Phantom 3D' ) ) { ?>
<h2>Enjoy this post in Phantom Menace 3D Style!</h2>
<div class='redblue-text'>
<?php echo $content; ?>
</div><!-- redblue-text -->
<?php
} else {
return $content;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment