Skip to content

Instantly share code, notes, and snippets.

@ThomasKujawa
Created November 18, 2014 18:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ThomasKujawa/8cf17d6722e476a68047 to your computer and use it in GitHub Desktop.
Save ThomasKujawa/8cf17d6722e476a68047 to your computer and use it in GitHub Desktop.
Wordpress | Toolbox | Autorenbox
<?php
/*
Module Name: WordPress Author Box.
Module URI: http://www.drweb.de/magazin/wordpress-autorenbox-ohne-plugin-erstellen/
Description: Call this function with &lt;?php andys_author_box(); ?&gt; 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&nbsp;<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'>&nbsp;|&nbsp;<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'>&nbsp;|&nbsp;<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'>&nbsp;|&nbsp;<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'>&nbsp;|&nbsp;<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'>&nbsp;|&nbsp;<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