Created
November 18, 2014 18:28
-
-
Save ThomasKujawa/8cf17d6722e476a68047 to your computer and use it in GitHub Desktop.
Wordpress | Toolbox | Autorenbox
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 | |
/* | |
Module Name: WordPress Author Box. | |
Module URI: http://www.drweb.de/magazin/wordpress-autorenbox-ohne-plugin-erstellen/ | |
Description: Call this function with <?php andys_author_box(); ?> wherever you want to display the box (posts and/or pages) [Frontend] | |
Author: "Andreas Hecht" | Lizenz GPL 2 http://www.gnu.org/licenses/gpl-2.0.html | |
Author URI: http://www.hechtmediaarts.com | |
*/ | |
/* Sicherheitsabfrage */ | |
if ( !class_exists('Toolbox') ) { | |
die(); | |
} | |
/* Ab hier kann's los gehen */ | |
function andys_author_box() { | |
?> | |
<?php if ( get_the_author_meta( 'description' ) ) : ?> | |
<div class='author-box'> | |
<div id='gravatarbild'> | |
<?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'revothemes_author_bio_avatar_size', 60 ), '', get_the_author_meta('display_name') ); ?> | |
</div> | |
<div id='Autorenname'> | |
<!-- < ?php echo _e('Autor: ', 'andysthemes'); the_author(); ? > --> | |
<span id='Autorenbeschreibung'> | |
<!-- < ?php echo ('. '); --> | |
<?php echo the_author_meta( 'description' ); ?> | |
</span> | |
<div class='Autorenlinks'> | |
<?php if ( get_the_author_meta( 'user_url' ) ) : ?> | |
<span id='Autorenwebseite'>Profile des Autors im Social Web <a href="<?php the_author_meta('user_url'); ?>"><?php echo _e('Website', 'andysthemes'); ?></a></span> | |
<?php endif; ?> | |
<?php if ( get_the_author_meta( 'twitter' ) ) : ?> | |
<span id='Autorentwitter'> | <a href="https://twitter.com/<?php the_author_meta('twitter'); ?>">Twitter</a></span> | |
<?php endif; ?> | |
<?php if ( get_the_author_meta( 'facebook' ) ) : ?> | |
<span id='Autorenfacebook'> | <a href="http://www.facebook.com/<?php the_author_meta('facebook'); ?>">Facebook</a></span> | |
<?php endif; ?> | |
<?php if ( get_the_author_meta( 'googleplus' ) ) : ?> | |
<span id='Autorengoogle'> | <a href="https://profiles.google.com/<?php the_author_meta('googleplus'); ?>">Google+</a></span> | |
<?php endif; ?> | |
<?php if ( get_the_author_meta( 'xing' ) ) : ?> | |
<span id='Autorenxing'> | <a href="https://www.xing.com/profile/<?php the_author_meta('xing'); ?>">XING</a></span> | |
<?php endif; ?> | |
<?php if ( get_the_author_meta( 'linkedin' ) ) : ?> | |
<span id='Autorenlinkedin'> | <a href="http://de.linkedin.com/in/<?php the_author_meta('linkedin'); ?>/">Linkedin</a></span> | |
<?php endif; ?> | |
</div><!-- end .authorsites --> | |
</div><!-- end .author-description --> | |
</div><!-- end .author-info --> | |
<?php endif; // get_the_author_meta( 'description' ) ?> | |
<?php | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment